这是indexloc提供的服务,不要输入任何密码
Skip to content

proposal: Use XXXRequest types in server handlers. #243

@jba

Description

@jba

We decided early on to use XXXParams on the client and server, because the enclosing request is just the method name + the params, and asking client users to provide the method name "foo" and then call Foo seemed cruelly redundant. And we naturally did the same on the server, so server handlers like a ToolHandler take CallToolParams.

But what we missed is that our server infrastructure might want to add request-scoped information besides the params. Auth information is one example (#237). We could also expose all the HTTP headers.

So while the client methods should continue to accept XXXParams, we should add the corresponding XXXRequest types that can include more, and have server handlers take XXXRequests. An XXXRequest struct will include the method name (just to match the spec) and the params, but may include more.

Metadata

Metadata

Assignees

Labels

proposalA proposal for an a new API or behavior. See CONTRIBUTING.md.release blockerThis issue blocks the release milestone with which it is associated.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions