mcp: small changes to CallTool structs (#60)

- Use `any` for CallToolResult.StructuredContent.

- Change the non-generic structs into aliases for the generic ones.
This commit is contained in:
Jonathan Amsterdam 2025-06-30 13:47:24 -04:00 • committed by GitHub
commit beed2f0677
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -17,7 +17,7 @@ import (
// A ToolHandler handles a call to tools/call.
// [CallToolParams.Arguments] will contain a map[string]any that has been validated
// against the input schema.
// Perhaps this should be an alias for ToolHandlerFor[map[string]any, map[string]any].
// TODO: Perhaps this should be an alias for ToolHandlerFor[map[string]any, map[string]any]?
type ToolHandler func(context.Context, *ServerSession, *CallToolParamsFor[map[string]any]) (*CallToolResult, error)
// A ToolHandlerFor handles a call to tools/call with typed arguments and results.