Skip to main content
Glama

trw_adopt_run

Transfer a run's pin to your session to resume or reclaim it. Handles abandoned runs and terminal status with optional force override.

Instructions

Transfer an existing run's pin to the caller's session.

Use when:

  • Resuming a run started by another session (fresh context, same task).

  • Reclaiming a run whose previous owner went away without delivering.

Guards:

  • Out-of-project run_path raises StateError (no force override).

  • Terminal status (delivered/complete/failed) requires force=True.

  • Live owner (heartbeat within pin_ttl_hours) requires force=True and emits run_adopted_potential_writer_conflict WARN when displaced.

Input:

  • run_path: absolute path to the run directory to adopt (required).

  • force: override terminal-status and live-owner guards.

Output: TrwAdoptRunResultDict with fields {adopted_run_id, previous_pin_key, from_pin_key, to_pin_key, adopted_ts, from_owner_was_live, force_used}.

Example: trw_adopt_run(run_path="/repo/.trw/runs//") → {"adopted_run_id": "", "from_pin_key": "sess-a", "to_pin_key": "sess-b", "force_used": false, ...}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
forceNo
run_pathNo
Behavior5/5

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

With no annotations provided, the description fully discloses behavior: guards (StateError for out-of-project, terminal status requiring force, live owner conflict), force parameter effects, and warning emission. This is comprehensive for a mutation tool.

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?

The description is well-structured with clear sections (Use when, Guards, Input, Output, Example). It is reasonably concise, though some redundancy exists (e.g., repeating force description in Guards and Input).

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

Completeness5/5

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

No output schema exists, so the description correctly lists output fields and provides an example. Combined with the comprehensive behavioral details, it leaves no gaps for the agent to infer.

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

Parameters4/5

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

Schema coverage is 0%, but the description compensates by explaining run_path as an absolute path and force as an override for guards. It adds meaning beyond schema defaults (false/empty string) but could provide examples of valid run_path values.

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?

The description explicitly states 'Transfer an existing run's pin to the caller's session,' which is a specific verb-resource combination. It clearly distinguishes this tool from siblings focused on other operations (e.g., trw_deliver, trw_init).

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?

The description provides explicit 'Use when' scenarios: resuming a run from another session or reclaiming an abandoned run. It also details guards and conditions, guiding the agent on when to use this tool versus alternatives.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/wallter/trw-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server