Skip to content
This repository was archived by the owner on Sep 18, 2025. It is now read-only.

Commit 1f6eef4

Browse files
authored
fix(mcp): ensure required field if nil (#278)
1 parent 4427df5 commit 1f6eef4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

internal/llm/agent/mcp-tools.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,15 @@ type MCPClient interface {
3333
}
3434

3535
func (b *mcpTool) Info() tools.ToolInfo {
36+
required := b.tool.InputSchema.Required
37+
if required == nil {
38+
required = make([]string, 0)
39+
}
3640
return tools.ToolInfo{
3741
Name: fmt.Sprintf("%s_%s", b.mcpName, b.tool.Name),
3842
Description: b.tool.Description,
3943
Parameters: b.tool.InputSchema.Properties,
40-
Required: b.tool.InputSchema.Required,
44+
Required: required,
4145
}
4246
}
4347

0 commit comments

Comments
 (0)