Skip to main content
Glama

提交 DSH 任务

dsh_run
Destructive

Submits a complete, verifiable work unit to the local DSH backend for asynchronous planning, file edits, and testing, returning a task ID for status polling and result retrieval.

Instructions

把一个可验收的完整工作单元(功能点/bug/测试修复批次/跨文件重构)交给本机 DSH 异步执行,立即返回 task_id。DSH 自己规划并执行多步工具调用(读代码、改文件、跑测试),一次任务应覆盖「实现 + 自测 + 证据」;不要提交单步/逐文件微任务。之后用 dsh_status 长轮询(wait_s 60–120)到终态,dsh_result 取结果;中断用 dsh_cancel。cwd 传当前项目绝对路径。

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "task": "<task>"
    },
    "name": "dsh_run"
  }
}

Input Schema

NameRequiredDescriptionDefault
cwdNo任务执行目录(绝对路径);缺省依次用 DSH_MCP_DEFAULT_CWD、worker 进程 cwd
taskYes完整工作单元描述,建议包含:目标、[已定决策]、[待你判断]、范围(可改/不可改、入口文件)、验收命令与期望、证据要求(变更文件+测试结果+风险);给目标与约束,不要写逐步操作清单
wait_sNo可选:提交后在本次调用里等待最多 N 秒(建议 60–120),减少 dsh_status 往返;任务未结束时返回中间状态
timeout_sNo任务超时秒数,默认 900;大任务可设 1800–3600
session_idNo续聊已有 DSH 会话时传入;同一 session 的任务串行执行
permission_modeNo权限模式,默认 auto(worker 按 cwd 能力自动选 workspace-write / danger-full-access)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.7.2

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The annotations already flag destructiveHint=true and openWorldHint=true, and the description explains why: DSH plans and executes multi-step tool calls that read code, modify files, and run tests. It also discloses the async contract (returns task_id immediately, mid-flight status when wait_s elapses) and that tasks in one session_id run serially. It stops short of spelling out what the destructive file writes mean for the workspace or unrecoverable state, which is the one piece the annotations can't convey.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Dense but front-loaded: purpose and unit-of-work definition come first, the micro-task exclusion second, the lifecycle routing third, and the cwd tip last. Nearly every clause earns its place, though the wait_s 60–120 range is repeated from the schema and could be dropped.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an async, open-world, destructive task submitter, the definition covers what the task should contain, what it returns (task_id), how to poll and collect results, how to cancel, and session serialization. With no output schema and full schema coverage, the remaining gap is only in consequence disclosure around file mutation and permission modes, which is modest.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so every parameter including cwd, wait_s, timeout_s, permission_mode, and session_id is already documented with ranges and defaults. The description only adds operational guidance beyond the schema, notably that cwd should be the current project's absolute path, plus the reminder to give goals and constraints rather than a step-by-step checklist. Useful reinforcement, but mostly redundant with a very rich schema, so baseline 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

A specific verb+resource: hand a complete verifiable work unit (feature/bug/test-fix/cross-file refactor) to local DSH for asynchronous execution and immediately get a task_id back. It also scopes what counts as a valid unit ('实现 + 自测 + 证据') and explicitly excludes single-step or per-file micro-tasks, which separates it from dsh_batch_run and the dsh_status/dsh_result siblings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives the when-not-to-use rule up front ('不要提交单步/逐文件微任务') and names the complete follow-up flow: poll with dsh_status (wait_s 60–120) to a terminal state, fetch with dsh_result, interrupt with dsh_cancel. The agent never has to infer which sibling comes next in the lifecycle.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.