Skip to main content
Glama

Patch Doc Section

patch_doc_section

Replace only one Markdown section (by heading) instead of the whole doc.

Pass expected_version (the version you read), or section_hash (sha256 of the
section body you read; GET /v1/documents/{key}/sections lists them). Either
way only your section must be unchanged: with rebase=true (the default) a
newer version whose change is elsewhere is merged (rebased=true in the
result); if your section changed you get 409 rebase_conflict with the base,
current and proposed text, or section_conflict in section_hash mode.
rebase=false refuses any newer version (409 version_conflict). The response
is compact unless include_content=true.

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": {
      "doc_key": "<doc_key>",
      "section_heading": "<section_heading>",
      "new_markdown": "<new_markdown>"
    },
    "name": "patch_doc_section"
  }
}

Input Schema

NameRequiredDescriptionDefault
agentNo
rebaseNo
doc_keyYes
new_markdownYes
section_hashNo
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.
include_contentNo
section_headingYes
expected_versionNo
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.4/5.0
Behavior5/5

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

Annotations only declare readOnly=false and destructiveHint=false; the description goes far beyond by spelling out the optimistic-concurrency model: default rebase=true merges when the other change is elsewhere, section-level conflicts return 409 rebase_conflict with base/current/proposed text, section_hash mode returns section_conflict, and rebase=false returns version_conflict. It also notes response compactness is controlled by include_content.

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?

Purpose is front-loaded in sentence one, followed by the versioning/conflict rules in a logical progression from happy path to failure modes. It is dense with jargon but each clause carries information an agent needs; the only looseness is that conflict-mode naming appears in a single run-on block.

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?

With eleven parameters, low schema coverage, and an output schema already documenting returns, the description covers the write/conflict path well but omits what return_current_on_conflict does and what agent/session_batch_id mean. Those omissions matter for a tool with this many optional knobs.

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 description coverage is only 9%, so the description must carry the load, and it does explain the four parameters most likely to be misused: expected_version, section_hash, rebase, and include_content. It leaves several of the eleven parameters (agent, session_batch_id, return_current_on_conflict) unexplained, which is a real gap given near-zero schema coverage.

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 first line gives a specific verb, resource, and scope: 'Replace only one Markdown section (by heading) instead of the whole doc.' That contrast immediately separates it from whole-document writers in the sibling list and tells an agent exactly what unit of content is affected.

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?

It states the precondition for calling (you must have read the section, hence expected_version or section_hash) and points to GET /v1/documents/{key}/sections to obtain hashes. It does not name the sibling tool to use when replacing an entire document, so routing is implied rather than explicit.

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.