on main help sign in
fix(mcp): avoid nil errors for tool parameters (#1245)
b896a25Bruno Krugel
CRUSH.md+1−1
@@ -54,7 +54,7 @@ func TestYourFunction(t *testing.T) {
54## Formatting
54## Formatting
55
55
56- ALWAYS format any Go code you write.
56- ALWAYS format any Go code you write.
57− - First, try `goftumpt -w .`.
57+ - First, try `gofumpt -w .`.
58 - If `gofumpt` is not available, use `goimports`.
58 - If `gofumpt` is not available, use `goimports`.
59 - If `goimports` is not available, use `gofmt`.
59 - If `goimports` is not available, use `gofmt`.
60 - You can also use `task fmt` to run `gofumpt -w .` on the entire project,
60 - 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 {
99}
99}
100
100
101func (b *McpTool) Info() tools.ToolInfo {
101func (b *McpTool) Info() tools.ToolInfo {
102− var parameters map[string]any
102+ parameters := make(map[string]any)
103− var required []string
103+ required := make([]string, 0)
104
104
105 if input, ok := b.tool.InputSchema.(map[string]any); ok {
105 if input, ok := b.tool.InputSchema.(map[string]any); ok {
106 if props, ok := input["properties"].(map[string]any); ok {
106 if props, ok := input["properties"].(map[string]any); ok {