-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Labels
P2Moderate issues affecting some users, edge cases, potentially valuable featureModerate issues affecting some users, edge cases, potentially valuable featurebugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomersimproves spec complianceWhen a change improves ability of SDK users to comply with spec definitionWhen a change improves ability of SDK users to comply with spec definitionready for workEnough information for someone to start working onEnough information for someone to start working on
Description
I noticed that this request:
{"jsonrpc": "2.0", "id": 1, "method": "tools/lit", "params": {}}... returns an error response (code -32601) as expected but this:
{"jsonrpc": "2.0", "id": 1, "method_": "tools/list", "params": {}}... returns nothing. I would expect that a missing method property or an unknown root property like methodX would throw and error. The JSON-RPC 2.0 spec says the server should return:
- -32600 "Invalid Request" for malformed JSON-RPC (missing required fields like
method) - -32602 "Invalid params" for bad parameters
I think the SDK should handle these but I'm not even able to write validation logic in my application code because an invalid RPC request never reaches my handler.
Claude tells me I can do something like this:
class ValidatingStdioTransport extends StdioServerTransport {
// Override message handling to add validation
}.. but I don't love that.
If a maintainer agrees that this validation should be in the SDK, I'd be more than happy to write a PR! Thank you for all your work on this!
felixweinberger
Metadata
Metadata
Assignees
Labels
P2Moderate issues affecting some users, edge cases, potentially valuable featureModerate issues affecting some users, edge cases, potentially valuable featurebugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomersimproves spec complianceWhen a change improves ability of SDK users to comply with spec definitionWhen a change improves ability of SDK users to comply with spec definitionready for workEnough information for someone to start working onEnough information for someone to start working on