@@ -98,40 +98,6 @@ func setSchema[T any](sfield **jsonschema.Schema, rfield **jsonschema.Resolved)
9898 return err
9999}
100100
101- // newRawHandler creates a rawToolHandler for tools not created through NewServerTool.
102- // It unmarshals the arguments into a map[string]any and validates them against the
103- // schema, then calls the ServerTool's handler.
104- // func newRawHandler(st *ServerTool) rawToolHandler {
105- // if st.Handler == nil {
106- // panic("st.Handler is nil")
107- // }
108- // return func(ctx context.Context, ss *ServerSession, rparams *CallToolParamsFor[json.RawMessage]) (*CallToolResult, error) {
109- // // Unmarshal the args into what should be a map.
110- // var args map[string]any
111- // if rparams.Arguments != nil {
112- // if err := unmarshalSchema(rparams.Arguments, st.inputResolved, &args); err != nil {
113- // return nil, err
114- // }
115- // }
116- // // TODO: generate copy
117- // params := &CallToolParamsFor[map[string]any]{
118- // Meta: rparams.Meta,
119- // Name: rparams.Name,
120- // Arguments: args,
121- // }
122- // res, err := st.Handler(ctx, ss, params)
123- // // TODO(rfindley): investigate why server errors are embedded in this strange way,
124- // // rather than returned as jsonrpc2 server errors.
125- // if err != nil {
126- // return &CallToolResult{
127- // Content: []Content{&TextContent{Text: err.Error()}},
128- // IsError: true,
129- // }, nil
130- // }
131- // return res, nil
132- // }
133- // }
134-
135101// unmarshalSchema unmarshals data into v and validates the result according to
136102// the given resolved schema.
137103func unmarshalSchema (data json.RawMessage , resolved * jsonschema.Resolved , v any ) error {
0 commit comments