Skip to main content
Glama

Plan a checkpoint recovery into a new session (read-only)

dsh_prepare_recovery
Read-onlyIdempotent

Loads a persisted task record and checkpoint read-only, verifies the current workspace matches, and returns a scrubbed recovery plan with a planToken without starting a runtime or model request.

Instructions

Read-only. Loads a persisted task record and checkpoint under DATA_ROOT/tasks with anchored, symlink-refusing reads, checks that the caller workspace matches the recorded workspace, and returns a bounded scrubbed plan with a planToken bound to the exact source record/checkpoint and current workspace state. Starts no runtime and makes no model request; never probes or reuses the recorded PID and never exposes prompts, context, environment, reasoning or the recorded argv. A source still in this bridge process's live map is refused; use dsh_continue_task. A missing or corrupt checkpoint is an explicit refusal. A source recorded accepted/starting/running produces a warning and requires allowUnsettledSource=true at recovery.

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": {
      "taskId": "<taskId>",
      "workspace": "<workspace>"
    },
    "name": "dsh_prepare_recovery"
  }
}

Input Schema

NameRequiredDescriptionDefault
taskIdYes
workspaceYesThe admitted current workspace; it must canonically match the workspace recorded for the task.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.8

TDQS

A4.3/5.0
Behavior5/5

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

Annotations already declare readOnlyHint/idempotent/non-destructive, and the description still adds substantial behavior beyond them: no runtime start, no model request, no PID probing or reuse, symlink-refusing anchored reads, scrubbing of prompts/context/environment/reasoning/argv, and explicit refusal for missing or corrupt checkpoints. The planToken binding to the exact source record and workspace state is exactly the kind of behavioral detail structured fields cannot 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?

Front-loaded and dense: 'Read-only' leads, followed by the operation sequence, then refusal and exclusion rules. Every clause carries information, though the run-on sentence bundling read mechanics, scrubbing guarantees, and the planToken would be easier to scan if split into separate sentences.

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?

With no output schema, the description correctly explains the return value (bounded scrubbed plan plus planToken) and covers the safety profile, refusal conditions, and live-source exclusion. The one real gap is the dangling allowUnsettledSource flag, which an agent is told it may need but cannot supply given the two-parameter schema.

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 50% (only workspace is documented), so the description must compensate. It strengthens workspace semantics ('the caller workspace matches the recorded workspace') and implies taskId identifies the persisted source record, but it never explains taskId's format, lookup scope, or failure mode when it does not exist. Worse, it references allowUnsettledSource=true, which does not appear in the input schema at all, so the parameter story is partially incomplete and partially unactionable.

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?

States a specific verb and resource (plan a checkpoint recovery into a new session) and enumerates the concrete steps: loads a persisted task record and checkpoint under DATA_ROOT/tasks, validates the caller workspace, and returns a bounded scrubbed plan with a bound planToken. This is clearly distinguishable from dsh_get_task or dsh_wait_task, and the read-only, planning-only nature is stated up front.

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

Usage Guidelines4/5

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

Gives explicit routing rules: a source still in the live map is refused and the agent is told to use dsh_continue_task instead, and unsettled states (accepted/starting/running) produce a warning requiring allowUnsettledSource=true. Clear context and one named alternative, but the relationship to the similarly named dsh_recover_task sibling is not clarified, leaving a plausible ambiguity unresolved.

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