{"record":{"id":"149c5227ecfad159","repo":"can1357/oh-my-pi","slug":"no-such-tool-xd-url-prefix-name-mounted-dev","errorCode":null,"errorMessage":"No such tool: ${XD_URL_PREFIX}${name}. Mounted devices: ${[...state.mountedNames].join(\", \")}. Active top-level tools are also dispatchable via ${XD_URL_PREFIX}<tool>.","messagePattern":"No such tool: (.+?)(.+?)\\. Mounted devices: (.+?)\\. Active top-level tools are also dispatchable via (.+?)<tool>\\.","errorType":"validation","errorClass":"ToolError","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/tools/xdev.ts","lineNumber":399,"sourceCode":"\treturn sections.join(\"\\n\\n\");\n}\n\nfunction shouldInlineXdevTool(\n\tstate: XdevState,\n\ttool: Tool,\n\tmode: XdevDocsMode,\n\tinlineGlobs: readonly Bun.Glob[],\n): boolean {\n\treturn (\n\t\tmode !== \"catalog\" &&\n\t\t(mode === \"inline\" || state.builtInNames.has(tool.name) || inlineGlobs.some(glob => glob.match(tool.name)))\n\t);\n}\n\nfunction resolveRequiredXdevTool(state: XdevState, name: string): Tool {\n\tconst inst = resolveXdevTool(state, name);\n\tif (!inst) {\n\t\tthrow new ToolError(\n\t\t\t`No such tool: ${XD_URL_PREFIX}${name}. Mounted devices: ${[...state.mountedNames].join(\", \")}. Active top-level tools are also dispatchable via ${XD_URL_PREFIX}<tool>.`,\n\t\t);\n\t}\n\treturn inst;\n}\n\n/** Execute an enabled canonical tool through `write xd://<tool>`. */\nexport async function dispatchXdevTool(\n\tstate: XdevState,\n\tname: string,\n\tcontent: string,\n\ttoolCallId: string,\n\tsignal?: AbortSignal,\n\tonUpdate?: AgentToolUpdateCallback,\n\tcontext?: AgentToolContext,\n): Promise<{ result: AgentToolResult<unknown>; xdev: XdevDispatch }> {\n\tlet xdev: XdevDispatch = { tool: name, mode: \"execute\" };\n\ttry {","sourceCodeStart":381,"sourceCodeEnd":417,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/tools/xdev.ts#L381-L417","documentation":"resolveRequiredXdevTool looks up a device by name among the tools mounted in the xdev state. If no mounted device (and no active top-level tool alias) matches the requested name, it throws this ToolError listing all currently mounted device names and noting that top-level tools can also be dispatched via xd://<tool>.","triggerScenarios":"Calling Write/dispatch with `xd://<name>` where <name> is misspelled, not mounted in this session, or refers to a tool that exists but was excluded/unmounted.","commonSituations":"Typo in the device name; the session was started without mounting that device; a device was renamed across versions; assuming every top-level tool is available under xd:// when it was excluded.","solutions":["Use one of the mounted device names listed in the error message.","Fix the spelling of the device name (check for case/typo differences).","Mount the needed device in the session before dispatching to it.","Call the tool directly (top-level) if appropriate, or via `xd://<tool>` only for active top-level tools."],"exampleFix":"// before\nwrite({ path: \"xd://browsers\", content: \"{...}\" })\n// after\nwrite({ path: \"xd://browser\", content: \"{...}\" }) // name from mounted list","handlingStrategy":"validation","validationCode":"if (!mountedDevices.includes(name)) throw new Error(`xd device not mounted: ${name}. Available: ${mountedDevices.join(\", \")}`);","typeGuard":"function isMounted(name: string, state: { mountedNames: Iterable<string> }): boolean { return new Set(state.mountedNames).has(name); }","tryCatchPattern":"try { await dispatch(path, content); } catch (e) { if (String(e.message).startsWith(\"No such tool:\")) { const mounted = e.message.match(/Mounted devices: ([^.]+)/)?.[1]?.split(\", \") ?? []; /* pick correct or mount device */ } else throw e; }","preventionTips":["Cache the mounted device list at session start and validate names against it.","Fix typos by exact-match lookup rather than guessing.","Mount required devices before dispatching.","Prefer top-level tool calls when the alias may not be available."],"tags":["xdev","tool-error","unknown-tool"],"backgroundTag":"unknown-tool-name","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}