Skip to main content
Glama

Update datafile

update_datafile
Destructive

Update a datafile. This is a partial update at the FIELD level: only the arguments you provide change. Provide json to replace the WHOLE document (its property order is preserved verbatim); omit it to change only metadata. To change PART of an existing document, prefer patch_datafile — it sends just the edit and cannot lose a concurrent write. Use this tool when you are replacing the whole document anyway; both preserve property order. Sending json here means get_datafile, change the object you got back, then send it all — pass expected_content_sha256 with that round trip so a change you did not see is reported instead of overwritten. Republish to push the change to the CDN.

Input Schema

NameRequiredDescriptionDefault
jsonNoReplacement JSON object for this datafile. Omit to leave the content unchanged. Property order is preserved verbatim.
schema_idNoId of the schema this datafile's JSON is validated against. Omit to leave the current binding unchanged.
datafile_idYesThe datafile id to update.
descriptionNoWhat this datafile holds. Omit to leave unchanged.
display_nameNoHuman-readable name. Omit to leave unchanged.
use_latest_schemaNoValidate against the latest (draft) schema version instead of the published one. Only applied when schema_id is also provided.
expected_content_sha256NoThe content_sha256 from the get/create/update that gave you the content you edited. When set, the update is rejected (FAILED_PRECONDITION) if the stored content changed since — do NOT retry the same json, because it was built from a document that no longer exists: get_datafile again, re-apply your change to the content you just read, and send that with the new content_sha256. Omit for a blind overwrite, which is fine when nothing else writes this datafile (e.g. content you just created).

Output Schema

NameRequiredDescriptionDefault
jsonNo
slugYes
schema_idNo
datafile_idYes
descriptionYes
display_nameYes
content_sha256No
last_published_pathNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations declare destructiveHint=true and idempotentHint=false, and the description explains the actual consequence: concurrent writes can be lost, with expected_content_sha256 turning that into a FAILED_PRECONDITION instead of silent overwrite. It also discloses the downstream effect that a republish is required to push the change to the CDN — real behavioral context not present in the annotations.

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?

Front-loaded with the core semantics and alternatives before the recovery procedure, which is the right order. It loses a little to redundancy — property-order preservation is asserted three times across the description and the schema, and the patch_datafile recommendation appears twice in slightly different forms.

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?

An output schema and full annotation set already cover returns and the safety profile, so the description's job is the mutation semantics and failure modes — both covered. The concurrency guidance, the patch alternative, and the republish requirement are everything an agent needs to call this correctly.

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 the baseline is 3, but the description adds genuine meaning on top: `json` replaces the entire document versus per-field metadata updates, and expected_content_sha256 is framed as part of a get → edit → send round trip with an explicit do-not-retry-the-same-json rule. The remaining parameters are left to the schema, which already documents them well.

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?

States a specific verb and resource and immediately qualifies the scope: field-level partial update of metadata, whole-document replacement when `json` is supplied. It explicitly distinguishes itself from the sibling patch_datafile, so an agent can route correctly without opening either 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?

Gives explicit routing rules: use patch_datafile to change part of an existing document, use this tool when replacing the whole document anyway. It also states when to omit `json` (metadata-only) and when to omit or supply expected_content_sha256, including the 'blind overwrite is fine when nothing else writes this datafile' case.

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