Skip to main content
Glama

apply document edits

native.apply_document_edits
DestructiveIdempotent

Apply exact, unique, non-overlapping search and replacement passages immediately. Read the current document first. Unread changes never block another edit.

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": {
      "work_id": "<work_id>",
      "arguments": "<arguments>",
      "expected_catalog_version": "<expected_catalog_version>",
      "read_skills": "<read_skills>",
      "request_key": "<request_key>"
    },
    "name": "native.apply_document_edits"
  }
}

Input Schema

NameRequiredDescriptionDefault
work_idYes
argumentsYes
read_skillsYesExact required native skills and their dependencies, copied from the accepted session bootstrap's skills array. Include only entries in that array. General mcp.* guides and native.{studio}.instructions are guidance, not native skill proofs.
request_keyYes
publication_proposal_idNoFor native Social scheduling, the exact server-approved publication proposal. This identifier cannot confer approval by itself.
expected_catalog_versionYesFor a new session, read a studios/{studio}/native/{pack} child toolset and copy invocation.catalog_version from a native tool descriptor. Do not use the top-level library version. For calls in an existing session, use that session proposal's catalog_version.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare destructiveHint=true, idempotentHint=true, and readOnlyHint=false, so the safety profile is covered. The description adds the real constraints an agent needs (uniqueness, no overlap, immediate application, read-first requirement), but omits key mutation behavior: atomicity of a batch of edits, what happens when a search passage fails to match, and how a stale expected_revision is rejected.

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?

Three short sentences, front-loaded with the core action and the legal-input constraint before the workflow prerequisite. No filler, though the third sentence about unread changes is somewhat terse and could be clearer about the mark-changes-read interaction.

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?

An output schema exists, so return values need not be described. However, for a destructive, nested, six-parameter document mutation, the description says nothing about failure modes, revision conflicts, or the relationship to mark_document_changes_read/undo_document_changes, leaving notable gaps.

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 50% and several parameters (expected_revision, read_skills, expected_catalog_version, publication_proposal_id, preserve_text) already carry their own schema descriptions. The description only adds meaning to the edits payload by imposing exact/unique/non-overlapping matching, while the session/provenance parameters (work_id, request_key, read_skills) get no mention at all.

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 concrete verb+resource ('apply ... search and replacement passages') and qualifies the edits as exact, unique, and non-overlapping, which tells an agent what kind of input is legal. It does not distinguish itself from close siblings such as native.find_and_replace_in_document, native.replace_document_body, or apply_studio_document_edits, so the agent must infer the difference.

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?

'Read the current document first' gives one clear prerequisite, and 'Unread changes never block another edit' clarifies that pending change-review does not gate further edits. There is no explicit statement of when to prefer this tool over the several replace/find-and-replace siblings, so usage is only implied.

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