Hands the model a tool catalog on each step, lets it load only the tools it needs with tool_pick, and narrows the visible tool set accordingly to reduce per-step tool schema tokens.
Install
# from npm (prebuilt)
dsh plugin --profile web add dsh-tool-picker
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:liujing9178/dsh-tool-picker
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
Progressive tool disclosure for DeepSeek Harness — 中文说明见 README.zh.md
Hand the model a tool catalog first, let it pick with tool_pick, then send only the picked tools' schemas on the next step. Built for large tool surfaces: on a real profile with 207 tools it cut the per-step tool payload from ~45,400 tokens to ~4,000.
Why
DSH injects every registered tool's schema into each model request. With many plugins and MCP servers that is tens of thousands of tokens per step, most of it for tools the task never touches.
before: 207 tools · 163,480 chars · ≈45,400 tokens / step
after : 11 eager tools + a ~3,000-token catalog + the picked ones
How it works
① catalog ctx.tools.schemas(agent) → grouped listing, budget-tiered
② present agent.ctx.systemPrompt.context({required:true}) → runtime context
③ pick tool_catalog / tool_pick / tool_search
④ apply agent.ctx.tools.restrict({ allow }) → only core ∪ picked ∪ bridges
- Catalog is a plain text listing (names, one-line descriptions, grouped by tool-name prefix). It is injected as a runtime context, so a GUI persona prompt can't clobber it.
- Picking is structured:
tool_pick({ add: [...], remove: [...], reset?: true }). - Applying uses
ToolsService.restrict({ allow }), the only DSH seam that narrows what the model can see and call. A whitelist mask, rebuilt from the agent-scoped view each step. - Loading takes effect on the next step (each step's tool set is frozen before the model speaks). That is a property of DSH, not a bug here.
Install
# from npm
dsh plugin --profile desktop add dsh-tool-picker
# or from a local checkout
dsh plugin --profile desktop add "link:/path/to/dsh-tool-picker"
Then add the bundle to the profile (or let the CLI do it) and restart DSH. The plugin appears in Settings → Plugins → Installed with an enable/disable switch, like any other plugin.
Config lives in the plugin's cordis.patch.yml (bundle layer) or your profile patch:
- insert:
- id: tool-picker
name: dsh-tool-picker
config:
enabled: "auto" # auto | on | off (quote it — bare off parses as boolean false)
minToolTokens: 10000 # absolute threshold
autoPct: 10 # or ≥10% of the context window
thresholdPct: 5 # catalog budget = min(5% × contextWindow, listingMaxTokens)
listingMaxTokens: 3000
contextWindow: 1000000
minCatalogSize: 12
maxSelected: 40
detailChars: 70
core: [read, write, edit, grep, glob, win_bash, todo_write, skill]
Tools it adds
| Tool | Purpose |
|---|---|
tool_catalog |
List the full catalog grouped by prefix (read-only) |
tool_pick |
Load/unload tools for the next step (add / remove / reset) |
tool_search |
Keyword search over the catalog (read-only) |
Costs and caveats
- One extra round-trip on the first step of a task (the model picks, then works). Selections persist across turns, so later turns pay nothing extra.
- Prompt cache prefix changes when the tool set changes. Pick once per task; don't churn the selection.
- Not available on the next step? Tools you didn't pick return
UNKNOWN_TOOLif called. The catalog andtool_pickresults both state the rule. - Compared to Anthropic's Tool Search Tool: that one defers loading server-side (
defer_loading), so the prompt cache survives. DeepSeek's Anthropic-compatible endpoint ignoresdefer_loading, so this plugin narrows the request client-side instead — same savings, at the cost of cache churn.
Design notes
See DESIGN.md for the source-level mapping (which DSH seam works and which silently does nothing), measurements, and failure modes. Two findings worth repeating:
- Rewriting
assembly.toolsin thesystem-prompt/assemblewaterfall is a no-op on DSH ≥ 0.2.1-rc.3 (return { ...transformed, tools }wins). ctx.tools.schemas()without a scope sees only the global layer — preset/agent-scoped tools (read,write,grep, …) are missing from it. Always measure withschemas(agent).
License
MIT
Links
More in this category
Tencent/WeKnora#dsh-weknora★ 38385
Four read-only tools over a WeKnora knowledge base: list knowledge bases, hybrid passage search, reassemble one document's chunks in order, and WeKnora's own cited RAG or ReAct-agent answer with a resumable session id.
DayuanJiang/next-ai-draw-io#dsh-plugin★ 37218
Draws draw.io diagrams in DeepSeek Harness through the next-ai-drawio MCP server: the link in the reply opens a live preview in the right sidebar, you can edit the diagram by hand, and each AI change is a version you can restore. Node.js 18+; npx downloads the MCP server on first use.
yikart/AiToEarn#dsh-plugin-aitoearn★ 28812
Generate copy, images and short videos, and publish with one click to Douyin, Kuaishou, Xiaohongshu, WeChat Official, Bilibili, Facebook, TikTok and more, covering the full content lifecycle from creation to publishing and monetization.
superdesigndev/treg★ 9804
Tool catalog for agents: search ~2,600 external endpoints (SEO and SERP, backlinks, social, people and company enrichment, ad libraries, scraping) by the task you want done, read each one's parameters and per-call price, then call it with the credential injected server-side. Ships the skill plus an MCP row that stays disabled until TREG_TOKEN is set.
T-Auto/dsh-ops★ 6039
Provides bash, PowerShell 7, and high-performance Rust tools for DSH on Windows to reduce token usage.
Hithink-Tech-Org/Financial-API#hithink-finance★ 4659
Query Hithink Finance data in DeepSeek Harness, view charts in chat, and save refreshable dashboards.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.