Skip to main content
Glama

Agent Patch Shared State

agent_patch_shared_state

Apply an RFC 6902 JSON Patch to a shared state slot.

Only EXECUTOR/COMMANDER roles may write. Human-locked slots return 403
HUMAN_SOVEREIGNTY_LOCKED. Use expected_version for optimistic concurrency;
expected_version=0 creates the slot (the patch applies to an empty state,
in `namespace`, default "default"). Set lease_seconds to hold a short
exclusive lease while working.

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": {
      "slot_key": "<slot_key>",
      "ops": "<ops>",
      "expected_version": "<expected_version>"
    },
    "name": "agent_patch_shared_state"
  }
}

Input Schema

NameRequiredDescriptionDefault
opsYes
agentNo
slot_keyYes
namespaceNo
lease_epochNo
lease_secondsNoOptional lease TTL in seconds. Default 900; allowed 5–3600.
idempotency_keyNoOptional. Retries with the same key and arguments within 24 h replay the first result (replayed=true) without a second write; a different body with the same key is idempotency_key_reused.
expected_versionYes
session_batch_idNo
return_current_on_conflictNo

Output Schema

NameRequiredDescriptionDefault

No arguments

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?

Annotations only supply readOnlyHint=false and destructiveHint=false; the description adds substantial behavior the annotations lack: role gating, the 403 HUMAN_SOVEREIGNTY_LOCKED outcome, optimistic-concurrency semantics, and lease holding. It doesn't describe how a failed patch interacts with the lease or what conflict returns look like (though an output schema exists).

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 core action and then layered constraints; sentences are dense with useful information and no filler. Slightly fragmented formatting but no wasted wording.

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

Completeness3/5

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

For a 10-parameter mutation tool with 20% schema coverage, several parameters (lease_epoch, session_batch_id, return_current_on_conflict, ops shape) are unexplained. The output schema relieves the need to document returns, but the input side is still underspecified.

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 20%, so the description must compensate and it partly does: expected_version=0 create semantics, namespace default, and lease_seconds purpose are explained. However ops format, agent, lease_epoch, session_batch_id, and return_current_on_conflict remain undocumented in both schema and description.

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: 'Apply an RFC 6902 JSON Patch to a shared state slot.' This clearly separates it from doc-oriented siblings such as upsert_shared_doc or patch_doc_section, which target documents rather than state slots.

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 useful context: only EXECUTOR/COMMANDER roles may write, human-locked slots fail, and expected_version=0 means create. It does not explicitly say when to prefer this over upsert_shared_doc or workspace_sync, so it stops short of full alternative routing.

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.