From b896a2584775d3b4f4179a2774350fee4b6313cf Mon Sep 17 00:00:00 2001 From: Bruno Krugel Date: Thu, 16 Oct 2025 14:34:50 -0300 Subject: [PATCH] fix(mcp): avoid nil errors for tool parameters (#1245) --- CRUSH.md | 2 +- internal/llm/agent/mcp-tools.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CRUSH.md b/CRUSH.md index 102ad43ca5758beee6515ab9da4054ddc92b9a9f..dee2e7ba62baeb2af691828ed67dddf3446d4525 100644 --- a/CRUSH.md +++ b/CRUSH.md @@ -54,7 +54,7 @@ func TestYourFunction(t *testing.T) { ## Formatting - ALWAYS format any Go code you write. - - First, try `goftumpt -w .`. + - First, try `gofumpt -w .`. - If `gofumpt` is not available, use `goimports`. - If `goimports` is not available, use `gofmt`. - You can also use `task fmt` to run `gofumpt -w .` on the entire project, diff --git a/internal/llm/agent/mcp-tools.go b/internal/llm/agent/mcp-tools.go index 6209efa29fb7d9a3a488ca730f6f8175e3b08a60..041cff490a59f1de51505e833cc7ee7866aa7644 100644 --- a/internal/llm/agent/mcp-tools.go +++ b/internal/llm/agent/mcp-tools.go @@ -99,8 +99,8 @@ func (b *McpTool) Name() string { } func (b *McpTool) Info() tools.ToolInfo { - var parameters map[string]any - var required []string + parameters := make(map[string]any) + required := make([]string, 0) if input, ok := b.tool.InputSchema.(map[string]any); ok { if props, ok := input["properties"].(map[string]any); ok {