Documentation
¶
Index ¶
- Constants
- func BuildArgFlagSet(tool *ToolDef) (*flag.FlagSet, map[string]any, error)
- func DerefFlagValues(fs *flag.FlagSet, vars map[string]any)
- type SchemaArray
- type SchemaObject
- type SchemaPrimitive
- type SchemaValue
- type ToolDef
- type ToolRegistry
- func (r *ToolRegistry) All() iter.Seq2[string, *ToolDef]
- func (r *ToolRegistry) CallTool(ctx context.Context, client api.Client, name string, args map[string]any) (map[string]json.RawMessage, error)
- func (r *ToolRegistry) Get(name string) (*ToolDef, bool)
- func (r *ToolRegistry) LoadTools(ctx context.Context, client api.Client) error
Constants ¶
View Source
const MCPURLPath = ".api/mcp/v1"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type SchemaArray ¶
type SchemaArray struct {
Type string `json:"type"`
Description string `json:"description"`
Items SchemaValue `json:"items,omitempty"`
}
func (SchemaArray) ValueType ¶
func (s SchemaArray) ValueType() string
type SchemaObject ¶
type SchemaObject struct {
Type string `json:"type"`
Description string `json:"description"`
Required []string `json:"required,omitempty"`
Properties map[string]SchemaValue `json:"properties"`
}
func (SchemaObject) ValueType ¶
func (s SchemaObject) ValueType() string
type SchemaPrimitive ¶
func (SchemaPrimitive) ValueType ¶
func (s SchemaPrimitive) ValueType() string
type SchemaValue ¶
type SchemaValue interface {
ValueType() string
}
type ToolDef ¶
type ToolDef struct {
Name string
RawName string `json:"name"`
Description string `json:"description"`
InputSchema SchemaObject `json:"inputSchema"`
OutputSchema SchemaObject `json:"outputSchema"`
}
type ToolRegistry ¶
type ToolRegistry struct {
// contains filtered or unexported fields
}
ToolRegistry keeps track of tools and the endpoints they originated from
func NewToolRegistry ¶
func NewToolRegistry() *ToolRegistry
func (*ToolRegistry) All ¶
func (r *ToolRegistry) All() iter.Seq2[string, *ToolDef]
All returns an iterator that yields the name and Tool definition of all registered tools
func (*ToolRegistry) CallTool ¶
func (r *ToolRegistry) CallTool(ctx context.Context, client api.Client, name string, args map[string]any) (map[string]json.RawMessage, error)
CallTool calls the given tool with the given arguments. It constructs the Tool request and decodes the Tool response
Click to show internal directories.
Click to hide internal directories.