{"record":{"id":"139ffa044c822a72","repo":"deepseek-ai/deepseek-harness","slug":"mcp-client-opts-servername-server-listed-tool","errorCode":null,"errorMessage":"mcp-client(${opts.serverName}): server listed tool \"${tool.name}\" more than once — invalid tool list","messagePattern":"mcp-client\\((.+?)\\): server listed tool \"(.+?)\" more than once — invalid tool list","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/mcp/mcp-client/src/tools.ts","lineNumber":157,"sourceCode":" *   during the swap phase (only after the fetch phase succeeded).\n * @returns A map of registered public tool names to their unregister\n *   disposers — the exact set of live registrations owned by this server.\n */\nexport async function syncTools(\n  client: Client,\n  ctx: Context,\n  opts: ToolBridgeOptions,\n  previous: ToolDisposers,\n): Promise<ToolDisposers> {\n  // Phase 1: fetch and build the next generation without touching the registry.\n  const definitions = new Map<string, ToolDefinition>()\n  let cursor: string | undefined\n  do {\n    const response = await listToolsUncached(client, cursor)\n    for (const tool of response.tools) {\n      const publicName = publicToolName(opts.serverName, tool.name)\n      if (definitions.has(publicName)) {\n        throw new Error(\n          `mcp-client(${opts.serverName}): server listed tool \"${tool.name}\" more than once — invalid tool list`,\n        )\n      }\n      definitions.set(publicName, createDefinition(\n        client,\n        ctx,\n        publicName,\n        tool.name,\n        tool.description ?? '',\n        tool.inputSchema,\n        supportedOutputSchema(tool.outputSchema),\n        tool.execution?.taskSupport === 'required',\n        opts,\n      ))\n    }\n    cursor = response.nextCursor\n  } while (cursor)\n","sourceCodeStart":139,"sourceCodeEnd":175,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/mcp/mcp-client/src/tools.ts#L139-L175","documentation":"Error \"mcp-client(${opts.serverName}): server listed tool \"${tool.name}\" more than once — invalid tool list\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/mcp/mcp-client/src/tools.ts:157 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the MCP server to list each tool only once."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}