@@ -40,6 +40,7 @@ type Annotations struct {
4040 Priority float64 `json:"priority,omitempty"`
4141}
4242
43+ // CallToolParams is used by clients to call a tool.
4344type CallToolParams struct {
4445 // This property is reserved by the protocol to allow clients and servers to
4546 // attach additional metadata to their responses.
@@ -48,20 +49,13 @@ type CallToolParams struct {
4849 Arguments any `json:"arguments,omitempty"`
4950}
5051
51- // When unmarshalling CallToolParams on the server side, we need to delay unmarshaling of the arguments.
52- func (c * CallToolParams ) UnmarshalJSON (data []byte ) error {
53- var raw struct {
54- Meta `json:"_meta,omitempty"`
55- Name string `json:"name"`
56- RawArguments json.RawMessage `json:"arguments,omitempty"`
57- }
58- if err := json .Unmarshal (data , & raw ); err != nil {
59- return err
60- }
61- c .Meta = raw .Meta
62- c .Name = raw .Name
63- c .Arguments = raw .RawArguments
64- return nil
52+ // CallToolParamsRaw is passed to tool handlers on the server.
53+ type CallToolParamsRaw struct {
54+ // This property is reserved by the protocol to allow clients and servers to
55+ // attach additional metadata to their responses.
56+ Meta `json:"_meta,omitempty"`
57+ Name string `json:"name"`
58+ Arguments json.RawMessage `json:"arguments,omitempty"`
6559}
6660
6761// The server's response to a tool call.
@@ -115,6 +109,10 @@ func (x *CallToolParams) isParams() {}
115109func (x * CallToolParams ) GetProgressToken () any { return getProgressToken (x ) }
116110func (x * CallToolParams ) SetProgressToken (t any ) { setProgressToken (x , t ) }
117111
112+ func (x * CallToolParamsRaw ) isParams () {}
113+ func (x * CallToolParamsRaw ) GetProgressToken () any { return getProgressToken (x ) }
114+ func (x * CallToolParamsRaw ) SetProgressToken (t any ) { setProgressToken (x , t ) }
115+
118116type CancelledParams struct {
119117 // This property is reserved by the protocol to allow clients and servers to
120118 // attach additional metadata to their responses.
0 commit comments