Subagent MCP tool calls don't execute in SDK versions 0.1.59+ (regression from 0.1.13)

Resolved 💬 3 comments Opened Dec 22, 2025 by helpflowdev Closed Dec 26, 2025

Summary

MCP tool calls from subagents (agents spawned via the Task tool) don't actually execute in SDK versions 0.1.59 and 0.1.75. The AI fabricates/hallucinates tool results instead of calling the actual MCP tools. This is a regression from version 0.1.13 where MCP tools work correctly.

Environment

  • Node.js: v20.19.5 (also tested on v22.19.0)
  • Platform: Windows 11 / WSL2
  • SDK versions tested:
  • 0.1.13 ✅ Works correctly
  • 0.1.59 ❌ Broken
  • 0.1.75 ❌ Broken

Reproduction Steps

  1. Create a multi-agent system with a main orchestrator and specialist subagents
  2. Register MCP servers with custom tools (e.g., WooCommerce API integration)
  3. Configure subagents with MCP tools in their tools array
  4. Have the main orchestrator delegate to a subagent via the Task tool
  5. The subagent should call an MCP tool (e.g., mcp__woocommerce__woocommerce_get_order)

Expected Behavior (SDK 0.1.13)

Server logs show MCP tool actually being called:

🔧 [TOOL CALL] Tool: mcp__woocommerce__woocommerce_get_order | ID: toolu_01UWBbbjT3t954PwewgC5pwL
[WOOCOMMERCE API] Getting order: AD1527473-NC (email: customer@example.com)
[WOOCOMMERCE API] Attempting fast path: customer filter
[WOOCOMMERCE API] Using full search fallback
[WOOCOMMERCE API] ✅ Found via fallback search: 9471724 (AD1527473-NC)

Actual Behavior (SDK 0.1.59+)

  • No [TOOL CALL] logs for MCP tools
  • No [WOOCOMMERCE API] logs (the underlying API is never called)
  • The AI fabricates/hallucinates order data and returns it as if the tool was called
  • Returns incorrect results based on made-up data

Code Structure

MCP Server Registration (using SDK pattern):

const createWooCommerceTools = require('./woocommerce-custom-tools');

// In query() call:
const result = await query({
  prompt: orchestratorPrompt,
  mcpServers: [
    createWooCommerceTools(tool, createSdkMcpServer),
    // ... other MCP servers
  ],
  allowedTools: [
    'mcp__woocommerce__woocommerce_get_order',
    'mcp__woocommerce__woocommerce_list_orders',
    // ... other tools
  ],
  agents: loadedAgents,
  // ...
});

MCP Tool Definition:

module.exports = function createWooCommerceTools(tool, createSdkMcpServer) {
  return createSdkMcpServer({
    name: 'woocommerce',
    version: '1.0.0',
    tools: [
      tool('woocommerce_get_order', 'Retrieve order by number',
        { order_number: z.string(), customer_email: z.string().optional() },
        async (args) => {
          // This handler is NEVER called in 0.1.59+
          const order = await woocommerceAPI.getOrderByNumberAndEmail(
            args.order_number,
            args.customer_email || null
          );
          return { content: [{ type: 'text', text: JSON.stringify(order, null, 2) }] };
        })
    ]
  });
};

Subagent Definition:

{
  name: 'order_specialist',
  tools: [
    'Read',
    'Grep',
    'mcp__woocommerce__woocommerce_get_order',
    'mcp__woocommerce__woocommerce_list_orders',
    // ...
  ],
  // ...
}

Comparison Evidence

| SDK Version | MCP Tool Call Logs | API Logs | Result |
|------------|-------------------|----------|--------|
| 0.1.13 | ✅ [TOOL CALL] Tool: mcp__woocommerce__... | ✅ [WOOCOMMERCE API] Getting order... | Correct data returned |
| 0.1.59 | ❌ No tool call logged | ❌ No API call logged | Fabricated data returned |
| 0.1.75 | ❌ No tool call logged | ❌ No API call logged | Fabricated data returned |

Impact

This is a critical regression for any multi-agent system that relies on MCP tools for data retrieval. The AI confidently returns fabricated data, making it impossible to trust subagent responses without checking server logs.

In our case, this caused VIP customer detection to fail because the AI would claim "VIP NOT FOUND" without ever checking the actual order data via the WooCommerce API.

Workaround

Pin SDK to version 0.1.13 in package.json:

"@anthropic-ai/claude-agent-sdk": "0.1.13"

(Note: Using ^0.1.13 or ^0.1.30 will still allow npm to install broken versions)

Additional Context

  • The main orchestrator's direct tool calls work fine in all versions
  • Only subagent (Task tool spawned agent) MCP tool calls are affected
  • Standard tools like Read and Grep work correctly in subagents
  • Only MCP tools (mcp__*) are affected

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗