CherryHQ/cherry-studio · error · Error

Unknown tool: ${name}

Error message

Unknown tool: ${name}

What it means

Generic Error thrown by the DiDi MCP server's CallToolRequest handler default branch when the requested tool name does not match any of the seven known tools (maps_textsearch, taxi_cancel_order, taxi_create_order, taxi_estimate, taxi_generate_ride_app_link, taxi_get_driver_location, taxi_query_order). The error propagates after being logged. It indicates the client invoked a tool name this server does not register.

Source

Thrown at src/main/ai/mcp/servers/didiMcp.ts:234

      try {
        switch (name) {
          case 'maps_textsearch':
            return await this.handleMapsTextSearch(args)
          case 'taxi_cancel_order':
            return await this.handleTaxiCancelOrder(args)
          case 'taxi_create_order':
            return await this.handleTaxiCreateOrder(args)
          case 'taxi_estimate':
            return await this.handleTaxiEstimate(args)
          case 'taxi_generate_ride_app_link':
            return await this.handleTaxiGenerateRideAppLink(args)
          case 'taxi_get_driver_location':
            return await this.handleTaxiGetDriverLocation(args)
          case 'taxi_query_order':
            return await this.handleTaxiQueryOrder(args)
          default:
            throw new Error(`Unknown tool: ${name}`)
        }
      } catch (error) {
        logger.error(`Error calling tool ${name}:`, error as Error)
        throw error
      }
    })
  }

  private async handleMapsTextSearch(args: any) {
    const { city, keywords, location } = args

    const params = {
      name: 'maps_textsearch',
      arguments: {
        keywords,
        city,
        ...(location && { location })
      }

View on GitHub (pinned to 726446b54c)

Solutions

  1. Call ListTools first and only invoke tool names from the returned list.
  2. Check spelling and casing of the tool name against the ListTools output.
  3. Update the DiDi MCP server to the version that provides the expected tool.
  4. If the tool was removed, switch to the replacement tool.

Example fix

// before
const result = await server.callTool('taxi_estimte', args) // typo

// after
const { tools } = await server.listTools()
const validNames = tools.map(t => t.name)
if (!validNames.includes(requestedName)) {
  throw new Error(`Tool '${requestedName}' not available. Known: ${validNames.join(', ')}`)
}
const result = await server.callTool(requestedName, args)
Defensive patterns

Strategy: validation

Validate before calling

const knownTools = [
  'maps_textsearch',
  'taxi_cancel_order',
  'taxi_create_order',
  'taxi_estimate',
  'taxi_generate_ride_app_link',
  'taxi_get_driver_location',
  'taxi_query_order'
]
if (!knownTools.includes(toolName)) {
  throw new Error(`Tool '${toolName}' is not available. Known tools: ${knownTools.join(', ')}`)
}

Type guard

function isKnownDiDiTool(name: string): boolean {
  return [
    'maps_textsearch',
    'taxi_cancel_order',
    'taxi_create_order',
    'taxi_estimate',
    'taxi_generate_ride_app_link',
    'taxi_get_driver_location',
    'taxi_query_order'
  ].includes(name)
}

Try / catch

try {
  await server.callTool(name, args)
} catch (e) {
  if (e instanceof Error && e.message.startsWith('Unknown tool:')) {
    // fetch ListTools and retry with a valid name
  }
  throw e
}

Prevention

When it happens

Trigger: The MCP client (LLM) calls a tool name not in the server's ListTools response — a typo, a removed tool, a version mismatch where the client knows a tool the server doesn't expose, or a hallucinated tool name.

Common situations: Model hallucination of a tool name; client and server version mismatch (client expects a newer/older tool set); tool name casing or spelling error; the tool was renamed or removed in a DiDi MCP update.

Related errors


AI-assisted analysis of CherryHQ/cherry-studio@726446b54c (2026-08-12). Data as JSON: /api/errors/9c415648a8eb8346. Report an issue: GitHub.