Skip to content

Commit cbee76f

Browse files
committed
reviewer comments
1 parent 28ead14 commit cbee76f

File tree

2 files changed

+2
-36
lines changed

2 files changed

+2
-36
lines changed

internal/readme/README.src.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ The latest version contains breaking changes:
99
- NewServerTool is replaced by AddTool. AddTool takes a Tool rather than a name and description, so you can
1010
set any field on the Tool that you want before associating it with a handler.
1111

12-
- ToolOptions are gone. If you don't want AddTool to infer a JSON Schema for you, you can construct one
13-
as a struct literal.
12+
- Tool options have been removed. If you don't want AddTool to infer a JSON Schema for you, you can construct one
13+
as a struct literal, or using any other code that suits you.
1414

1515
- AddPrompts, AddResources and AddResourceTemplates are similarly replaced by singular methods which pair the
1616
feature with a handler. The ServerXXX types have been removed.

mcp/tool.go

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -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.
137103
func unmarshalSchema(data json.RawMessage, resolved *jsonschema.Resolved, v any) error {

0 commit comments

Comments
 (0)