Documentation
¶
Index ¶
- func AddTool[In, Out any](c *Convertor, t *mcp.Tool, handler mcp.ToolHandlerFor[In, Out])
- func MapToDict(m map[string]any) (*starlark.Dict, error)
- func ToStarlarkValue(v any) (starlark.Value, error)
- func UnpackDict(d *starlark.Dict) (map[string]any, error)
- type Convertor
- func (c *Convertor) ExecuteTool(ctx context.Context, req *mcp.CallToolRequest, input ExecuteInput) (*mcp.CallToolResult, ExecuteOutput, error)
- func (c *Convertor) GetSchemaTool(ctx context.Context, req *mcp.CallToolRequest, input GetSchemaInput) (*mcp.CallToolResult, GetSchemaOutput, error)
- func (c *Convertor) Register(srv *mcp.Server)
- func (c *Convertor) SearchTool(ctx context.Context, req *mcp.CallToolRequest, input SearchInput) (*mcp.CallToolResult, SearchOutput, error)
- type ExecuteInput
- type ExecuteOutput
- type GetSchemaInput
- type GetSchemaOutput
- type JSON
- type SearchHit
- type SearchInput
- type SearchOutput
- type Tool
- type ToolDetail
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToStarlarkValue ¶
ToStarlarkValue converts native Go types to starlark.Value
Types ¶
type Convertor ¶
type Convertor struct {
// contains filtered or unexported fields
}
func NewConvertor ¶
func NewConvertor() *Convertor
func (*Convertor) ExecuteTool ¶
func (c *Convertor) ExecuteTool(ctx context.Context, req *mcp.CallToolRequest, input ExecuteInput) ( *mcp.CallToolResult, ExecuteOutput, error, )
func (*Convertor) GetSchemaTool ¶
func (c *Convertor) GetSchemaTool(ctx context.Context, req *mcp.CallToolRequest, input GetSchemaInput) ( *mcp.CallToolResult, GetSchemaOutput, error, )
func (*Convertor) SearchTool ¶
func (c *Convertor) SearchTool(ctx context.Context, req *mcp.CallToolRequest, input SearchInput) ( *mcp.CallToolResult, SearchOutput, error, )
type ExecuteInput ¶
type ExecuteInput struct {
Code string `json:"code" jsonschema:"Starlark code to execute tool calls via call_tool(tool_name, input)"`
}
type ExecuteOutput ¶
type ExecuteOutput struct {
Result any `json:"result" jsonschema:"Result returned by the executed code"`
}
type GetSchemaInput ¶
type GetSchemaInput struct {
Tools []string `json:"tools" jsonschema:"List of tool names for which details schema is needed"`
}
type GetSchemaOutput ¶
type GetSchemaOutput struct {
Results []ToolDetail
}
type JSON ¶
type JSON = json.RawMessage
type SearchHit ¶
type SearchHit struct {
ToolDetail
Score int `json:"score" jsonschema:"Rank score of the result"`
}
type SearchInput ¶
type SearchInput struct {
Query string `json:"query" jsonschema:"Search terms (space separated) to find availabel tools"`
Detail string `json:"detail" jsonschema:"Level of detail the search output is required in. (brief, detail, full)"`
Limit *int `json:"limit" jsonschema:"Maximum number of results to return"`
}
type SearchOutput ¶
type SearchOutput struct {
Hits []SearchHit `json:"hits" jsonschema:"Results of the search call"`
}
type ToolDetail ¶
type ToolDetail struct {
Name string `json:"name" jsonschema:"Name of the tool"`
Description string `json:"description" jsonschema:"Description of the tool"`
InputSchema any `json:"input_schema" jsonschema:"Input parameters of the tool"`
OutputSchema any `json:"output_schema" jsonschema:"Output structure of the tool"`
}
Click to show internal directories.
Click to hide internal directories.