Documentation
¶
Index ¶
- Variables
- func HandleAdd(args map[string]interface{}) (*mcp.CallToolResult, error)
- func HandleDivide(args map[string]interface{}) (*mcp.CallToolResult, error)
- func HandleMultiply(args map[string]interface{}) (*mcp.CallToolResult, error)
- func HandleSubtract(args map[string]interface{}) (*mcp.CallToolResult, error)
- type CalculationError
Constants ¶
This section is empty.
Variables ¶
View Source
var Handlers = map[string]server.ToolHandlerFunc{ "add": HandleAdd, "subtract": HandleSubtract, "multiply": HandleMultiply, "divide": HandleDivide, }
View Source
var Tools = []mcp.Tool{ { Name: "add", Description: "Add two numbers", InputSchema: mcp.ToolInputSchema{ Type: "object", Properties: map[string]interface{}{ "a": map[string]interface{}{ "type": "number", "description": "First number", }, "b": map[string]interface{}{ "type": "number", "description": "Second number", }, }, }, }, { Name: "subtract", Description: "Subtract two numbers", InputSchema: mcp.ToolInputSchema{ Type: "object", Properties: map[string]interface{}{ "a": map[string]interface{}{ "type": "number", "description": "First number", }, "b": map[string]interface{}{ "type": "number", "description": "Second number", }, }, }, }, { Name: "multiply", Description: "Multiply two numbers", InputSchema: mcp.ToolInputSchema{ Type: "object", Properties: map[string]interface{}{ "a": map[string]interface{}{ "type": "number", "description": "First number", }, "b": map[string]interface{}{ "type": "number", "description": "Second number", }, }, }, }, { Name: "divide", Description: "Divide two numbers", InputSchema: mcp.ToolInputSchema{ Type: "object", Properties: map[string]interface{}{ "a": map[string]interface{}{ "type": "number", "description": "First number (dividend)", }, "b": map[string]interface{}{ "type": "number", "description": "Second number (divisor)", }, }, }, }, }
Functions ¶
func HandleAdd ¶ added in v0.5.0
func HandleAdd( args map[string]interface{}, ) (*mcp.CallToolResult, error)
func HandleDivide ¶ added in v0.5.0
func HandleDivide( args map[string]interface{}, ) (*mcp.CallToolResult, error)
func HandleMultiply ¶ added in v0.5.0
func HandleMultiply( args map[string]interface{}, ) (*mcp.CallToolResult, error)
func HandleSubtract ¶ added in v0.5.0
func HandleSubtract( args map[string]interface{}, ) (*mcp.CallToolResult, error)
Types ¶
type CalculationError ¶
type CalculationError struct {
Message string
}
CalculationError represents an error during calculation
func (CalculationError) Error ¶
func (e CalculationError) Error() string
Click to show internal directories.
Click to hide internal directories.