Skip to main content
Glama

set_thread_result

Destructive

Store a task's structured JSON result in its thread, notify waiters, and let requesters read the output; calls are fenced by the claim lease to reject stale work.

Instructions

Attach a task's structured result (arbitrary JSON). Upserts one result per thread and notifies waiters via a thread_result_set event. Use when finishing a task so a requester or parent can read the output. Fenced by your claim: pass claim_lease_id from the claim response; if the lease lapsed and someone else took the thread (or it was released), the call is refused (claim_lost) and nothing is stored, so stop the work. When the server sets MAIDAN_CHANGE_REFUSE_WORKFLOW_PATHS (its GitHub token cannot push workflow files), a maidan.change.result/1 with status changed, a github_branch target and a diff touching .github/workflows/ is refused with invalid params naming the files and nothing is stored: drop the workflow edit and set the result again.

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": {
      "thread_id": "<thread_id>",
      "result": "<result>",
      "claim_lease_id": "<claim_lease_id>"
    },
    "name": "set_thread_result"
  }
}

Input Schema

NameRequiredDescriptionDefault
resultYesstructured JSON result payload (an object)
thread_idYes
claim_lease_idYesthe fencing token from the claim response's thread.claim_lease_id

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv479.0.0

TDQS

A4.5/5.0
Behavior5/5

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

The annotations only declare destructiveHint=true, idempotentHint=false and openWorldHint=true; the description supplies the substance behind them: one result per thread is upserted (replacing any prior payload), waiters are notified via a thread_result_set event, and a stale claim_lease_id causes a claim_lost refusal with nothing stored. It also discloses an environment-dependent validation rule that no annotation could 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?

Core behavior and the primary use case are front-loaded in the first two sentences, and each subsequent clause carries a distinct operational fact (fencing, then the workflow-path refusal). The final workflow clause is long and dense relative to how rare that condition is, which slightly dilutes scanability.

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 a no-output-schema mutation tool with a nested JSON payload, the description covers storage semantics, notification side effects, and two distinct refusal paths with their error signals. The remaining gap is minor: it does not say what a successful response contains or enumerate any error other than claim_lost and invalid params.

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?

With 67% schema coverage, the description usefully explains the two non-obvious parameters: result is arbitrary structured JSON an object must carry, and claim_lease_id is the fencing token taken 'from the claim response' whose lapse causes refusal. It adds the consequence semantics (fencing, refusal, nothing stored) rather than restating the schema, though thread_id remains unelaborated.

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 opens with a specific verb and resource: 'Attach a task's structured result (arbitrary JSON)', then adds the exact storage semantics ('Upserts one result per thread and notifies waiters via a thread_result_set event'). This clearly separates it from the read-side sibling get_thread_result and from the other set_thread_* tools, which mutate different facets of a thread.

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?

'Use when finishing a task so a requester or parent can read the output' gives a clear triggering condition, and the description spells out two failure regimes (claim_lost, and the .github/workflows/ refusal under MAIDAN_CHANGE_REFUSE_WORKFLOW_PATHS) with explicit 'stop the work' / 'drop the edit' instructions. No sibling alternative is named (e.g. get_thread_result for reading), so it falls short of a full 5, but the when/when-not guidance is unusually concrete.

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

Deploy Server

Other Tools