Documentation
¶
Index ¶
- Constants
- type ApprovalFn
- type Command
- type CommandFn
- type Expression
- type FunctionDefinition
- func (f *FunctionDefinition) GetAdditionalEnvironment(jsonArgs string) (map[string]string, error)
- func (f *FunctionDefinition) GetCommandWithArgs(jsonArgs string) (string, []string, error)
- func (f *FunctionDefinition) GetEnvironment(jsonArgs string) (map[string]string, error)
- func (f *FunctionDefinition) GetWorkingDirectory(jsonArgs string) (string, error)
- func (f *FunctionDefinition) NeedApproval(ctx context.Context, jsonArgs string) bool
- type Variables
Constants ¶
View Source
const FunctionArgumentNameAll = "@"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command string
func (Command) CommandFn ¶
func (c Command) CommandFn(fd FunctionDefinition) CommandFn
type Expression ¶
type Expression string
func (Expression) CommandFn ¶
func (c Expression) CommandFn(fd FunctionDefinition) CommandFn
func (Expression) Validate ¶
func (c Expression) Validate() error
type FunctionDefinition ¶
type FunctionDefinition struct {
Name string `yaml:"-" json:"name" usage:"The name of the function"`
Description string `yaml:"description,omitempty" json:"description" usage:"The description of the function"`
Parameters mcp.ToolInputSchema `yaml:"parameters,omitempty" json:"parameters" usage:"The parameter definition of the function"`
Approval string `yaml:"approval,omitempty" json:"approval" usage:"Expression to check if user approval is needed before execute this tool"`
Command string `` /* 183-byte string literal not displayed */
CommandExpr string `` /* 180-byte string literal not displayed */
Environment map[string]string `` /* 145-byte string literal not displayed */
AdditionalEnvironment map[string]string `` /* 181-byte string literal not displayed */
WorkingDir string `yaml:"workingDir,omitempty,omitempty" json:"workingDir,omitempty" usage:"The working directory for the command"`
//will be filled at runtime (and should not be filled by user in any way)
CommandFn CommandFn `yaml:"-" json:"-"`
ApprovalFn ApprovalFn `yaml:"-" json:"-"`
}
func (*FunctionDefinition) GetAdditionalEnvironment ¶
func (f *FunctionDefinition) GetAdditionalEnvironment(jsonArgs string) (map[string]string, error)
func (*FunctionDefinition) GetCommandWithArgs ¶
func (f *FunctionDefinition) GetCommandWithArgs(jsonArgs string) (string, []string, error)
func (*FunctionDefinition) GetEnvironment ¶
func (f *FunctionDefinition) GetEnvironment(jsonArgs string) (map[string]string, error)
func (*FunctionDefinition) GetWorkingDirectory ¶
func (f *FunctionDefinition) GetWorkingDirectory(jsonArgs string) (string, error)
func (*FunctionDefinition) NeedApproval ¶
func (f *FunctionDefinition) NeedApproval(ctx context.Context, jsonArgs string) bool
type Variables ¶
type Variables struct {
FunctionDefinition FunctionDefinition `json:"fd"`
Arguments string `json:"args"`
}
Click to show internal directories.
Click to hide internal directories.