Skip to main content
Glama

Save capsule state

save_state

Add or update state items in a capsule. Items are upserted by id: pass an existing item id to modify it (including marking it "superseded", which is how items are deleted — the trail is kept), or omit id to create a new item. Requires base_revision to match the capsule's current revision; a mismatch is rejected with stale_revision. Set next_action to tell the next agent what to do.

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": {
      "capsule_id": "<capsule_id>",
      "base_revision": "<base_revision>",
      "items": "<items>"
    },
    "name": "save_state"
  }
}

Input Schema

NameRequiredDescriptionDefault
itemsYes
capsule_idYes
next_actionNo
base_revisionYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior4/5

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

Goes well beyond the annotations by disclosing that deletion is a soft delete via status 'superseded' with the trail retained, and that a revision mismatch is rejected with the specific error 'stale_revision'. It does not cover batch atomicity (whether a partial failure rolls back) or what the response contains, which keeps it short of a 5.

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

Conciseness5/5

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

Three dense sentences, front-loaded with the core action, then the upsert rule, then the concurrency contract. Every clause carries information an agent needs and there is no filler.

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 non-destructive, non-idempotent mutation with no output schema, the description covers the write semantics, the soft-delete path, and the optimistic-concurrency requirement. Only the return value (presumably a new revision) and all-or-nothing behavior on multi-item batches are unaddressed.

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 description coverage is 0%, so the description must carry the load. It explains id (upsert key), base_revision (must match current revision), and next_action (guidance for the next agent), but says nothing about type, status, confidence, source, or refs, leaving half the item fields undocumented in prose.

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

Purpose4/5

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

States a specific verb and resource ('Add or update state items in a capsule') and immediately narrows it to an upsert-by-id operation, so the agent knows this is a batch write to capsule state. It does not explicitly distinguish itself from the sibling update_state_item, leaving the agent to infer that this one handles multiple items.

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 clear operational context: pass an id to modify, omit id to create, and use status 'superseded' to delete. It never names an alternative tool or states when not to use this one, so the comparison with update_state_item or append_blocks is left implicit.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources