Skip to main content
Glama

Patch model

patch_model

Apply an RFC 6902 JSON Patch document to a model and run the reactive pipeline. Unlike 'mutate' (a flat address→value map), a patch expresses array insert/remove/move and test/copy ops, e.g. [{"op":"add","path":"/order/items/-","value":{...}}, {"op":"remove","path":"/order/items/0"}]. 'path' fields use RFC 6901 JSON Pointer (slash-separated, '-' for array append), NOT the $.-rooted address form. Same result shape and ROLLBACK/schema error handling as 'mutate'.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe model id.
patchYesAn RFC 6902 JSON Patch: an array of {op, path, value?, from?} operations applied in order.
includeTracesNoInclude the full derivation/constraint trace in the result (default false).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
tracesNoFull derivation/constraint traces (only when includeTraces:true).
successNoTrue when the mutation committed.
metaUpdatedNoMeta paths recomputed.
mutatedPathsNoBase paths written.
derivedUpdatedNoDerived paths recomputed.
dispatchedEffectsNoIds of effects dispatched.
flaggedConstraintsNoIds of FLAG-policy constraints that fired.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observed

TDQS

A3.9/5.0
Behavior1/5

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

The description is rich with behavioral detail: rollback/schema error handling, reactive pipeline, and JSON Pointer semantics. However, the description explicitly includes 'remove' operations in the patch and gives an example of removing an array item, while the annotations declare destructiveHint=false. This is an annotation contradiction, so the score must be 1 per the rubric.

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 description is dense but every sentence contributes: it defines the operation, gives usage contrast, includes a concrete example, and warns about pointer syntax. It is front-loaded and not wordy, although slightly long due to the rich example.

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

Completeness4/5

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

Given the output schema exists, returning values needn't be described. The description covers patch operation detail, path format, relationship to mutate, and rollback/schema handling. It is nearly complete, but the destructiveHint contradiction means the overall contract is not fully safe or coherent.

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 coverage is 100%, so baseline is 3. The description adds meaningful semantic detail above the schema: the patch parameter is explained with concrete op examples, the path field disambiguation, and the '-' append syntax. The other parameters are adequately described in the schema.

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 description states a specific verb and resource: 'Apply an RFC 6902 JSON Patch document to a model and run the reactive pipeline.' It also directly distinguishes itself from the sibling tool 'mutate', so an agent can tell exactly what patch_model does without opening the schema.

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

Usage Guidelines5/5

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

It explicitly contrasts with 'mutate' (a flat address→value map) and says a patch expresses array insert/remove/move and test/copy ops. It also clarifies the path syntax is RFC 6901 slash-based pointer, NOT the $-rooted form. This gives clear when-to-use and when-not-to-use guidance.

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.

TDQS

A3.9/5.0
Disambiguation4/5

Most tools have clearly distinct purposes, but get_audit explicitly subsumes get_history and explain, and get_state with paths overlaps get_field, creating minor selection ambiguity. The detailed descriptions help, but an agent could still reach for the wrong getter.

Naming Consistency4/5

Naming is overwhelmingly consistent: snake_case with verb_noun structure and coherent get_/create_/delete_ clusters. Minor deviations like bare verbs (mutate, explain, restore, snapshot) and eval instead of evaluate prevent a perfect score.

Tool Count3/5

27 tools is above the comfortable range and feels heavy, especially with several overlapping audit/state getters that could be consolidated. That said, the domain is broad enough that the count is defensible, so it is heavy but not chaotic.

Completeness4/5

The tool set covers the full model lifecycle well: create, validate, test, mutate, evolve, read, delete, plus snapshot/restore, audit, blobs, views, library, and expression evaluation. Minor gaps like explicit export/import or separate view-management tools are workable around.