Skip to content
MyDSHMy DSH Field Notes
中文
Independently maintained; not affiliated with DeepSeek. No association with mydsh.dev or other MyDSH sites.

Home/Developers & plugin dev/MCP & tool definitions

When a tool name is rejected: telling the two UNKNOWN_TOOL shapes apart

After pointing at a third-party gateway you get UNKNOWN_TOOL/400 and cannot tell whether your tool name or the gateway is at fault.

VerifiedVersion and environmentChecked 2026-11-14
Source
the ToolNotFoundError definition in packages/core/tools
Checked
2026-11-14

ToolNotFoundError in the source throws two messages, and whether there is a colon and a second clause separates them:

MessageMeaningWhere to look
unknown tool "<name>"The name is registered nowhereWhether the gateway renamed or truncated tools, or an intermediary rewrote the call
unknown tool "<name>": <reachableFrom>The name is visible but the presentation layer forbids calling it directlyNot the gateway.Check DSH_TOOLS_MODE and the preset's tool-presentation

The second shape is the one that gets misdiagnosed

Its typical setting is PTC mode: the model may only call run_code directly, so other native names are visible but rejected on direct call, with a note on where to call them from. This has nothing to do with a gateway, yet the text reads like a protocol error and the instinct is to go check the gateway.

Locating it in one pass

  1. Read the second clause. If there is : …, take the presentation branch and stop looking at the gateway.
  2. Without the clause, capture one outbound request and compare each tools[].function.name against the locally registered names.
  3. Identical names plus UNKNOWN_TOOL means a local problem; differing names mean a gateway or intermediary rewrote them.
The error design is actually good: it extends HarnessError so 'no such tool' is routable versus 'the tool failed' in retry, sandbox, and replay logic. The pity is that the two messages differ by a single colon, easily missed when skimming.

What counts as working

Check every line. All of them pass or the job is not done.

  • You can tell the two shapes apart from the message
  • For the second you check tool-presentation, not the gateway
  • For the first you capture the request and compare tools[].function.name

Where it fails

Symptom, cause, what to do — written in the order it actually happens.

SymptomCauseWhat to do
Treating a presentation refusal as a gateway problemA second clause after the colon means it is localRead the clause first; if present, leave the gateway alone

Sources

Verified means measured here. Compiled means every line carries a source.