-
Notifications
You must be signed in to change notification settings - Fork 284
mcp: change tool handler design #325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
v2 fixed more tests unexport ToolFor fix some tests
| func (k knowledgeBase) DeleteObservations(ctx context.Context, req *mcp.ServerRequest[*mcp.CallToolParamsFor[DeleteObservationsArgs]]) (*mcp.CallToolResultFor[struct{}], error) { | ||
| var res mcp.CallToolResultFor[struct{}] | ||
| func (k knowledgeBase) DeleteObservations(ctx context.Context, req *mcp.ServerRequest[*mcp.CallToolParams], args DeleteObservationsArgs) (*mcp.CallToolResult, struct{}, error) { | ||
| var res mcp.CallToolResult |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: preexisting: just inline into the literal below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand.
| }) | ||
| } | ||
| } | ||
| // func TestMCPServerIntegration(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please explain what specifically is broken about this. I can fix as soon as you land this.
|
Not sure if I'm commenting on the right PR and fwiw, but I've had some trouble understanding the API changes. It seems kinda clumsy now having to specify input and output types both for tool handlers when those are never ever used and/or input and output schemas have already been defined as part of the |
|
Sorry, the issue is #327 |
Change the design of tool handlers by removing genericity from the common path. - `ToolHandler` gets the args as a `json.RawMessage`. Using Server.AddTool does no unmarshaling or schema validation. - `ToolHandlerFor`, installed with `AddTool`, are the only generic pieces. TODO: uncomment and fix some tests
WIP
Description TBD.