Skip to content

Commit d9abb7e

Browse files
committed
GIE-497: pass meta to a toolset
1 parent 68ae731 commit d9abb7e

1 file changed

Lines changed: 20 additions & 12 deletions

File tree

pkg/tools/tooldef.go

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)