Skip to main content
Glama

patch_story

Atomically edit a story's plan-authored fields in the manifest without hand-editing JSON, avoiding write races with the scheduler's advance tick.

Instructions

Edit a story's plan-authored fields (agent_instructions, model, persona, risk, dependencies, acceptance, pr_url, summary, tdd_split, backend, blocked_by: a list of ":<story_key>" strings) without hand-editing the manifest JSON. files is not patchable: use ingest_plan to re-ingest.

Hand-editing the manifest races the scheduler's 60s advance_all_plans tick - a read-modify-write on either side can clobber the other's write. This tool takes the same _plan_lock the scheduler and dispatch_story use, so the edit is atomic with respect to it. Only the fields above may be set; status transitions go through set_story_status, not this tool.

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": {
      "plan_name": "<plan_name>",
      "story_key": "<story_key>",
      "fields": "<fields>"
    },
    "name": "patch_story"
  }
}

Input Schema

NameRequiredDescriptionDefault
fieldsYes
plan_nameYes
story_keyYes

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so: it discloses the concurrency hazard (racing the scheduler's 60s advance_all_plans tick), the exact mitigation (_plan_lock, same lock as the scheduler and dispatch_story), and the atomicity guarantee. It also flags what cannot be changed and where that operation belongs instead.

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 with the verb and field list, then rationale; every sentence carries information (scope, exclusion, race condition, lock, alternative). The parenthetical field enumeration is dense and slightly hard to scan, but nothing is redundant.

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 mutation tool with no annotations, it covers the critical concerns: concurrency safety, mutation scope, and the sibling to use for out-of-scope changes; an output schema exists so return values need no explanation. Only the identity parameters (plan_name, story_key) are left undefined.

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% and `fields` is a free-form object with additionalProperties, so the description must compensate — it does by enumerating the permitted keys and specifying the `blocked_by` string format ('<plan>:<story_key>'). The gap is that `plan_name` and `story_key` are never explained, leaving their expected format implicit.

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 ('Edit a story's plan-authored fields') and enumerates exactly which fields are in scope, so an agent can tell it apart from set_story_status or patch_plan without opening a schema. The explicit exclusion of `files` further sharpens the boundary.

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 explicit when-to-use (avoid hand-editing the manifest JSON), explicit when-not-to-use ('status transitions go through set_story_status, not this tool'), and names the correct alternative for the excluded case ('use ingest_plan to re-ingest'). Both the alternative tool and the condition selecting it are named.

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