File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -117,19 +117,27 @@ func (d ToolDef) ToServerTool(handler func(api.ToolHandlerParams) (*api.ToolCall
117117 inputSchema .Required = required
118118 }
119119
120- return api.ServerTool {
121- Tool : api.Tool {
122- Name : d .Name ,
123- Description : d .Description ,
124- InputSchema : inputSchema ,
125- Annotations : api.ToolAnnotations {
126- Title : d .Title ,
127- ReadOnlyHint : ptr .To (d .ReadOnly ),
128- DestructiveHint : ptr .To (d .Destructive ),
129- IdempotentHint : ptr .To (d .Idempotent ),
130- OpenWorldHint : ptr .To (d .OpenWorld ),
131- },
120+ tool := api.Tool {
121+ Name : d .Name ,
122+ Description : d .Description ,
123+ InputSchema : inputSchema ,
124+ Annotations : api.ToolAnnotations {
125+ Title : d .Title ,
126+ ReadOnlyHint : ptr .To (d .ReadOnly ),
127+ DestructiveHint : ptr .To (d .Destructive ),
128+ IdempotentHint : ptr .To (d .Idempotent ),
129+ OpenWorldHint : ptr .To (d .OpenWorld ),
132130 },
131+ }
132+
133+ if d .AdditionalFields != nil {
134+ tool .Meta = map [string ]any {
135+ "AdditionalFields" : d .AdditionalFields ,
136+ }
137+ }
138+
139+ return api.ServerTool {
140+ Tool : tool ,
133141 Handler : handler ,
134142 }
135143}
You can’t perform that action at this time.
0 commit comments