Skip to main content
Glama

Patch datafile

patch_datafile

Edit an EXISTING datafile's JSON in place without resending the whole document — the right tool for changing one field of a large datafile, appending a blog post to a list, or fixing a word in a long string. Apply ordered operations (set / remove / replace_in / test) addressed by a dot-path from the document root (e.g. 'posts[slug=hello].title', or 'posts[-]' with op 'set' to APPEND). Pass values as raw JSON — the platform owns the escaping. For a SMALL change to a LARGE string use replace_in (find→replace, must match exactly once) so you send a few bytes. For a large NEW value send it with value_encoding=base64 (or gzip+base64) plus a value_sha256, so transcription damage is rejected instead of silently written. This is SAFER than update_datafile, not just cheaper: the patch is applied to the content it just read and the write is gated on that exact content, so a concurrent write is always reported rather than clobbered — no read-modify-write race, even with no arguments from you. The result is validated against the datafile's bound schema before it lands; a patch that would break the schema is rejected and nothing is written. Property order is preserved: untouched parts of the document come back byte-identical, so the change you make is the whole diff. Set republish=true to push the result to the CDN path it was last published at.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
slugNothe datafile slug (provide this or datafile_id)
republishNoafter patching, re-publish to the CDN path this datafile was last published at. Errors if it has never been published (use publish_datafile with an explicit public_path first); the patch still applied.
operationsYesordered edits applied to the datafile's stored JSON
datafile_idNothe datafile id (provide this or slug)
expected_content_sha256Nothe content_sha256 from the get_datafile you built these operations from. If the stored content has moved since, the patch is REFUSED — nothing is applied, nothing is written. REQUIRED when any path addresses an array element by numeric index (items[2]), because that is a claim about the document's current shape whose failure is otherwise SILENT: if an element shifted, the write is still internally consistent and edits the wrong one. Optional for self-locating paths — items[slug=my-post], items[-] (append), or a plain key — which mean the same thing whatever the document holds, so appending to a large collection needs no read. Independently of this argument, the write is always gated on the content the patch itself just read, so it can never clobber a concurrent write.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
datafileYes
public_urlNo

Schema Changelog

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

  1. First observed

TDQS

A4.9/5.0
Behavior5/5

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

The description discloses critical behavioral traits: concurrency safety (no read-modify-write race), schema validation before writing, property order preservation, and the role of expected_content_sha256 for index-based paths. These details go far beyond the sparse annotations and set accurate expectations for side effects and failure modes.

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 long but each sentence contributes useful information, covering purpose, operations, safety, schema validation, and republish behavior. While it could be slightly more concise, the density of important details justifies the length.

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?

The description covers all essential aspects: operation types, path syntax, concurrency guarantees, schema validation, republish behavior, and integrity checks. No critical context is missing for an agent to correctly invoke the tool, even in complex scenarios.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds meaningful context to parameters beyond the input schema, such as 'Pass values as raw JSON' and guidance on value_encoding and expected_content_sha256. Since the schema already has detailed descriptions, the combination gives a complete understanding of each parameter's intent.

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 clearly states the tool's purpose: editing an existing datafile's JSON in place without resending the whole document. It also distinguishes it from update_datafile by highlighting safety and efficiency, making the tool's role unambiguous.

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?

The description provides explicit guidance on when to use this tool (small changes to large datafiles, appending to lists, fixing substrings) and when to prefer specific options like replace_in or base64 encoding. It also contrasts with update_datafile and explains the republish option, leaving no ambiguity.

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

A4/5.0
Disambiguation5/5

Every resource family follows the same verb+noun pattern and each tool name uniquely identifies a resource-action pair (create_app vs create_app_version vs update_app vs publish_app). Closest overlaps like analyze_resource vs get_resource_graph and patch_datafile vs update_datafile are explicitly differentiated by their descriptions, so misselection risk is low despite the scale.

Naming Consistency5/5

Names are almost uniformly verb_noun snake_case with a consistent lifecycle vocabulary: create/get/update/delete/list/publish/unpublish/version. Minor outliers like whoami and run_schedule_now are idiomatic and do not break the predictability of the set.

Tool Count1/5

At 93 tools this far exceeds the calibration's 50+ extreme-mismatch case. The count is inflated by repeating create/get/update/delete/version/publish/unpublish across ten resource families; even though each family is systematic, the combined surface is very hard for an agent to navigate and keep in context.

Completeness4/5

Core CRUD/publish/version lifecycles are present for apps, workflows, endpoints, schedules, schemas, datafiles, and api templates, and dependency analysis is well covered. However, secret creation/updating, asset upload, custom-domain deletion, and version-range enumeration for several resource types are absent or left to the external dashboard, so agents hit a few manual dead ends.

Resources