on main help sign in
fix(mcp): avoid nil errors for tool parameters (#1245)
commitb896a2584775d3b4f4179a2774350fee4b6313cf authorBruno Krugel <brunokrugel@gmail.com> dateThu 16 Oct 2025, 14:34 (1 year ago) parent6166fc6
2 files changed+3−3
CRUSH.md+1−1 internal/llm/agent/mcp-tools.go+2−2
CRUSH.md+1−1
@@ -54,7 +54,7 @@ func TestYourFunction(t *testing.T) {
5454## Formatting
5555
5656- ALWAYS format any Go code you write.
57− - First, try `goftumpt -w .`.
57+ - First, try `gofumpt -w .`.
5858 - If `gofumpt` is not available, use `goimports`.
5959 - If `goimports` is not available, use `gofmt`.
6060 - You can also use `task fmt` to run `gofumpt -w .` on the entire project,
internal/llm/agent/mcp-tools.go+2−2
@@ -99,8 +99,8 @@ func (b *McpTool) Name() string {
9999}
100100
101101func (b *McpTool) Info() tools.ToolInfo {
102− var parameters map[string]any
103− var required []string
102+ parameters := make(map[string]any)
103+ required := make([]string, 0)
104104
105105 if input, ok := b.tool.InputSchema.(map[string]any); ok {
106106 if props, ok := input["properties"].(map[string]any); ok {