Skip to main content
Glama

apply_preview

Preview how an RFC 6902 JSON Patch changes a document without writing anything, returning the patched result and a summary of semantic changes or the failing operation.

Instructions

Preview what an RFC 6902 JSON Patch does to a document, without writing anything.

Supports add, remove, replace, move, copy and test. Returns the patched document and a semantic summary of what changed versus the original. A failing operation is reported with its index and reason, and nothing is returned in that case.

Args: a: file path, or the document itself when inputs='text'. patch: the patch as a JSON array (or a JSON string of one). inputs, format, strip_comments, encoding: as in diff_files. max_result_chars: the result is cut off after this many characters (the summary is not).

Input Schema

NameRequiredDescriptionDefault
aYes
patchYes
formatNoauto
inputsNofiles
encodingNoauto
strip_commentsNo
max_result_charsNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does substantial work: it declares the side-effect-free nature, enumerates the supported operations, describes the return payload (patched document plus semantic summary), and specifies failure semantics (failing operation reported with index and reason, no result returned). It stops short of stating what happens on unreadable files or malformed non-patch input.

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?

The behavioural summary is front-loaded and free of filler, and the Args block is easy to scan. The only weakness is that several arguments are covered by a single cross-reference rather than stated directly.

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

Completeness5/5

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

For a 7-parameter, non-destructive tool with an output schema, the description covers what it does, what it returns, how truncation interacts with the result, and how failures surface. The return-value details are appropriately brief because an output schema exists.

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 supply the meaning. It does well for 'a', 'patch', and 'max_result_chars' (including the useful detail that the summary is not truncated), but 'format', 'inputs', 'strip_comments' and 'encoding' are deferred wholesale to 'as in diff_files', leaving the agent to consult another definition.

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 opening sentence names a specific verb (preview), a specific resource (an RFC 6902 JSON Patch applied to a document) and a scope qualifier ('without writing anything'). It also clearly separates the tool from the sibling as_json_patch, which produces patches rather than consuming them.

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 implied by 'preview ... without writing anything' and by the note that 'inputs, format, strip_comments, encoding' behave 'as in diff_files', which points the agent at a sibling for shared semantics. However, it never explicitly states when to prefer this over another tool, nor does it name as_json_patch as the way to generate the patch this tool consumes.

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