@@ -11,7 +11,6 @@ import (
1111 "fmt"
1212 "reflect"
1313
14- "github.com/modelcontextprotocol/go-sdk/internal/util"
1514 "github.com/modelcontextprotocol/go-sdk/jsonschema"
1615)
1716
@@ -90,7 +89,7 @@ func newServerTool[In, Out any](t *Tool, h ToolHandlerFor[In, Out]) (*serverTool
9089func setSchema [T any ](sfield * * jsonschema.Schema , rfield * * jsonschema.Resolved ) error {
9190 var err error
9291 if * sfield == nil {
93- * sfield , err = SchemaFor [T ]()
92+ * sfield , err = jsonschema . For [T ]()
9493 }
9594 if err != nil {
9695 return err
@@ -126,31 +125,6 @@ func unmarshalSchema(data json.RawMessage, resolved *jsonschema.Resolved, v any)
126125 return nil
127126}
128127
129- // SchemaFor returns a JSON Schema for type T.
130- // It is like [jsonschema.For], but also uses "mcp" struct field tags
131- // for property descriptions.
132- //
133- // For example, the call
134- //
135- // SchemaFor[struct{ B int `mcp:"desc"` }]()
136- //
137- // returns a schema with this value for "properties":
138- //
139- // {"B": {"type": "integer", "description": "desc"}}
140- func SchemaFor [T any ]() (* jsonschema.Schema , error ) {
141- // Infer the schema based on "json" tags alone.
142- s , err := jsonschema .For [T ]()
143- if err != nil {
144- return nil , err
145- }
146-
147- // Add descriptions from "mcp" tags.
148- if err := addDescriptions (reflect .TypeFor [T ](), s ); err != nil {
149- return nil , err
150- }
151- return s , nil
152- }
153-
154128// schemaJSON returns the JSON value for s as a string, or a string indicating an error.
155129func schemaJSON (s * jsonschema.Schema ) string {
156130 m , err := json .Marshal (s )
0 commit comments