πŸ”§ Error Fixes
Β· 2 min read

Claude Code Tool Use Failed Fix: Function Calling Errors (2026)


Claude Code failed to use a tool:

Error: tool_use_failed: invalid tool call

Or tools are not being recognized. Here is how to fix it.

Fix 1: Check MCP configuration

Tools come from MCP servers. Verify your config:

# Check MCP config
cat ~/.claude/mcp.json

# Should contain tool definitions
{
  "mcpServers": {
    "server-name": {
      "command": "node",
      "args": ["./server.js"]
    }
  }
}

Fix 2: Verify tool is registered

The MCP server must register tools correctly:

// Server must return tools in list
server.setRequestHandler(ListToolsRequestSchema, async () => {
  return {
    tools: [{
      name: "my-tool",
      description: "Tool description",
      inputSchema: {
        type: "object",
        properties: {
          param: { type: "string" }
        }
      }
    }]
  };
});

Fix 3: Fix tool parameters

Claude expects specific parameter formats:

{
  "name": "my-tool",
  "inputSchema": {
    "type": "object",
    "properties": {
      "query": {
        "type": "string",
        "description": "Search query"
      }
    },
    "required": ["query"]
  }
}

Fix 4: Check tool name

Tool names must match exactly:

# List available tools
claude /tools

# Check tool names in MCP server
curl http://localhost:3000/tools

Fix 5: Restart Claude Code

After changing MCP config:

# Exit and restart
/exit
claude

Claude Code loads tools on startup.

Fix 6: Update MCP SDK

Outdated SDK can cause compatibility issues:

# Update MCP SDK
npm update @modelcontextprotocol/sdk

# Or reinstall
npm install @modelcontextprotocol/sdk@latest

Fix 7: Check API version

Ensure Claude Code and MCP server use compatible versions:

# Check Claude Code version
claude --version

# Check MCP SDK version
npm list @modelcontextprotocol/sdk

Still not working?

  1. Check server logs β€” MCP server may have errors
  2. Test tool directly β€” Call the MCP server manually
  3. Use MCP Hub β€” Find working tools at mcp.so
  4. Check Anthropic docs β€” Tool use documentation

FAQ

Why are my MCP tools not showing in Claude Code?

The most common cause is incorrect MCP configuration. Check ~/.claude/mcp.json to ensure your server is configured correctly. Also restart Claude Code after changing MCP config.

How do I test if an MCP tool is working?

Use claude /tools to list available tools. You can also test the MCP server directly with curl to verify it responds to tool calls.

Can I use multiple MCP servers at once?

Yes. Configure each server separately in your MCP config. Claude Code can connect to multiple servers simultaneously and use tools from all of them.

Related: Claude Code Complete Guide Β· MCP Complete Developer Guide Β· MCP Server Connection Refused Fix Β· What is MCP? Β· Best MCP Servers 2026