{"record":{"id":"652bb8909bb6a74c","repo":"continuedev/continue","slug":"invalid-mcp-tool-reference-toolref-colon-sep","errorCode":null,"errorMessage":"Invalid MCP tool reference \"${toolRef}\": colon-separated tool references cannot contain whitespace. Use format \"https://server:tool_name\" without spaces.","messagePattern":"Invalid MCP tool reference \"(.+?)\": colon-separated tool references cannot contain whitespace\\. Use format \"https://server:tool_name\" without spaces\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/config-yaml/src/markdown/agentFiles.ts","lineNumber":145,"sourceCode":"\n      // Check if there's a colon after the protocol\n      if (lastColonIndex > protocolEndIndex) {\n        const afterLastColon = toolRef.substring(lastColonIndex + 1);\n\n        // Check if it's a port number (only digits), empty string, or a tool name\n        if (/^\\d+(?:$|[/?#])/.test(afterLastColon)) {\n          // It's a port number, treat the whole thing as the server\n          const mcpServer = toolRef;\n          tools.push({ mcpServer });\n          mcpServerSet.add(mcpServer);\n        } else if (\n          afterLastColon === \"\" ||\n          /^[a-zA-Z0-9_-]+$/.test(afterLastColon)\n        ) {\n          // It's a tool name (or empty string)\n          // Reject references with whitespace to prevent silent misconfigurations\n          if (/\\s/.test(toolRef)) {\n            throw new Error(\n              `Invalid MCP tool reference \"${toolRef}\": colon-separated tool references cannot contain whitespace. ` +\n                `Use format \"https://server:tool_name\" without spaces.`,\n            );\n          }\n\n          const mcpServer = toolRef.substring(0, lastColonIndex);\n          const toolName = afterLastColon;\n\n          tools.push({ mcpServer, toolName });\n          mcpServerSet.add(mcpServer);\n        } else {\n          throw new Error(\n            `Invalid URL-based MCP tool reference \"${toolRef}\": the part after the last colon must be either a port number or a valid tool name (alphanumeric, underscores, hyphens).`,\n          );\n        }\n      } else {\n        // No colon after the protocol, treat the whole thing as the server\n        const mcpServer = toolRef;","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/continuedev/continue/blob/5522c6f44ca0ac3528b37244818fbfa39b5af470/packages/config-yaml/src/markdown/agentFiles.ts#L127-L163","documentation":"In parseAgentFileTools, a URL-like tool reference containing a colon was checked after the last colon; when it looks like a tool name/port but the whole reference contains whitespace, it is rejected to prevent silent misconfiguration.","triggerScenarios":"A tools entry like 'https://my server:tool_name' or 'https://server:my tool' — URL-form reference with any whitespace anywhere in the string.","commonSituations":"Copy/pasting tool references with trailing spaces or line-wrapped URLs, or YAML flow lists inserting spaces.","solutions":["Remove all whitespace from the URL-form tool reference","Use the exact format https://server:tool_name","Lint agent file tool lists for spaces"],"exampleFix":"# before\ntools:\n  - \"https://my server:tool_name\"\n# after\ntools:\n  - \"https://myserver:tool_name\"","handlingStrategy":"validation","validationCode":"const valid = toolRefs.every(r => /^\\S+$/.test(r));","typeGuard":"function isCleanToolRef(ref: string): boolean { return !/\\s/.test(ref); }","tryCatchPattern":"try { parseAgentFileTools(refs); } catch (e) { if (e.message.includes('whitespace')) { /* strip spaces and retry */ } }","preventionTips":["Quote tool references in YAML lists","Trim copy/pasted references"],"tags":["mcp","tools","whitespace","agent-file"],"backgroundTag":"malformed-tool-reference","analyzedSha":"5522c6f44ca0ac3528b37244818fbfa39b5af470","analyzedAt":"2026-08-27T11:28:54.683Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}