fix(mcp): avoid nil errors for tool parameters (#1245)

Bruno Krugel created

Change summary

CRUSH.md                        | 2 +-
internal/llm/agent/mcp-tools.go | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)

Detailed changes

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,

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 {