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

Registering a minimal custom tool: from a patch entry to a real call

Wanting to expose an internal endpoint as a tool the model can call, with no idea how many steps registration takes.

To be testedVersion and environmentChecked 2026-11-14
Requires
the minimal plugin must work first
Checked
2026-11-14
Honest note: this item has not been completed here. The minimal plugin loads (measured), but registering a tool's name, parameter schema, and handler into the tool registry is not done. What follows is the path and known facts, not verified steps — if you get it working, please contribute a record using the template.

Three known layers

LayerWhat it takesVerified?
Package loadspackage.json + cordis.patch.yml + apply()Verified, see the minimal plugin item
Entry is composedinsert an id in the patch; it shows in dump-configVerified
Tool callable by the modelregister name/schema/handler with the tool registryNot verified — what this item must fill in

What tool calls look like in the event log

Every call records two events, tool/call and tool/result, and the result holds {content:[{type:"tool-result", content:[{type:"text"…}], isError}]}. Measured: isError is always false, with failure described in the text (see the tool failure item). So when registering your own tool, do not rely on isError to mark failure.

What completing this needs

  • A tool-registration service injectable through ctx — its exact name was not found, which is where this stopped.
  • One real call: run a minimal task and have the model invoke your registered tool.
  • Confirm the name field in tool/call matches what you registered.
I am not going to invent steps here. 'What is known and where it stopped' is more useful than an unrun registration procedure: following the latter, you would not know whether the doc is wrong or you are.

What counts as working

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

  • The minimal plugin item already passes (prerequisite)
  • You know isError is always false and failures live in the text
  • The blocker is stated plainly rather than papered over

Where it fails

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

SymptomCauseWhat to do
Cannot find the tool-registration service nameNot found here; this is the real blockerTrace from the exports of packages/core/tools, or print the injectable services on ctx

Sources

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