Skip to main content
Glama

save_document

Save an edited Markdown document only if it matches the expected content revision, preventing overwrites and retaining prior content snapshots.

Instructions

Save the user's edited Markdown document against its expected content revision. Retains prior content snapshots.

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": {
      "id": "<id>",
      "path": "<path>",
      "expectedIdentity": "<expectedIdentity>",
      "expectedRevision": "<expectedRevision>",
      "content": "<content>"
    },
    "name": "save_document"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYes
pathYes
contentYes
workspacePathNoTrusted absolute project path from this chat; pass on every call. null selects personal storage. Omission uses only the environment default.
expectedIdentityYes
expectedRevisionYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.5.1

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false, destructiveHint=false and openWorldHint=false, and the description adds real context on top: the write is guarded by an expected content revision (optimistic concurrency) and prior content snapshots are retained, so the operation is versioned rather than clobbering. It stops short of saying what happens on a revision mismatch (error vs. overwrite) or what permissions are required, which matters 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.

Conciseness5/5

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

Two short sentences with no filler, front-loading the operation and following with the versioning/snapshot detail. Every clause carries information an agent needs.

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 5-required-parameter mutation with no output schema and sparse schema descriptions, the definition covers the core risk (stale-revision protection, retained snapshots) but omits conflict behavior, return value, and the identity/path relationship. Annotations carry the safety profile, so it is adequate but not complete.

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 only 17% of 6 parameters, so the description must compensate and it only partly does: 'against its expected content revision' explains the role of expectedRevision, and 'edited Markdown document' hints at content. The distinction between id, path, expectedIdentity (a 64-hex hash) and workspacePath's null/personal-storage semantics is left entirely to the schema, which does not cover them.

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 ('Save the user's edited Markdown document') plus the concurrency token it writes against, which separates it from read_document/read_project_document siblings. It does not explicitly name any alternative, but the write-vs-read split is unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is only implied: the definition frames the call as saving an already-edited document, so an agent can infer when to use it. There is no explicit when-not guidance (e.g., use read_document first to obtain the revision, or that a stale expectedRevision will fail), nor any mention of save_board as the sibling for non-document content.

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