@@ -171,15 +171,15 @@ func (s *Server) AddTool(t *Tool, h ToolHandler) {
171171 func () bool { s .tools .add (st ); return true })
172172}
173173
174- // toolFor returns a shallow copy of t and a [ToolHandler] that wraps h.
174+ // ToolFor returns a shallow copy of t and a [ToolHandler] that wraps h.
175175// If the tool's input schema is nil, it is set to the schema inferred from the In
176176// type parameter, using [jsonschema.For].
177177// If the tool's output schema is nil and the Out type parameter is not the empty
178178// interface, then the output schema is set to the schema inferred from Out.
179179//
180- // Most users will call [AddTool]. Use [toolFor ] if you wish to wrap the ToolHandler
181- // before calling [Server.AddTool].
182- func toolFor [In , Out any ](t * Tool , h ToolHandlerFor [In , Out ]) (* Tool , ToolHandler ) {
180+ // Most users will call [AddTool]. Use [ToolFor ] if you wish to modify the tool's
181+ // schemas or wrap the ToolHandler before calling [Server.AddTool].
182+ func ToolFor [In , Out any ](t * Tool , h ToolHandlerFor [In , Out ]) (* Tool , ToolHandler ) {
183183 tt , hh , err := toolForErr (t , h )
184184 if err != nil {
185185 panic (fmt .Sprintf ("ToolFor: tool %q: %v" , t .Name , err ))
@@ -303,7 +303,7 @@ func setSchema[T any](sfield **jsonschema.Schema, rfield **jsonschema.Resolved)
303303// If the tool's output schema is nil and the Out type parameter is not the empty
304304// interface, then the copy's output schema is set to the schema inferred from Out.
305305func AddTool [In , Out any ](s * Server , t * Tool , h ToolHandlerFor [In , Out ]) {
306- s .AddTool (toolFor (t , h ))
306+ s .AddTool (ToolFor (t , h ))
307307}
308308
309309// RemoveTools removes the tools with the given names.
0 commit comments