Skip to main content
Glama

file_update

Append a new version to an existing shared file.

Omit expected_version to append prior-max-plus-one. Pass the version from file_get when editing a shared file so a concurrent writer is not overwritten. A mismatch writes nothing and returns status=conflict with the file id and a short preview, not the file body. Re-read with file_get (offset / limit) and retry. If the file is published, a successful new version is eagerly mirrored to the Railway bucket. Old versions are never mutated.

To add a dated section to a large file, read the tail with a negative offset and call file_append instead of rewriting the whole body.

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": {
      "file_id": "<file_id>",
      "content": "<content>"
    },
    "name": "file_update"
  }
}

Input Schema

NameRequiredDescriptionDefault
agentNoOverride agent identity
contentYesNew file body (markdown, raw HTML, teamshared.diagram/v1 or teamshared.diagram/v2, or teamshared.sheet/v1 JSON/YAML)
file_idYesFile UUID to update
content_formatNoOverride content format ('markdown', 'html', 'diagram', or 'sheet'); defaults to the file's current format
expected_versionNoLatest version from file_get. Omit to append unconditionally. A mismatch writes nothing and returns status=conflict with file_id, current_version, updated_by, updated_at, total_chars, and a short preview. The live file body is not included.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / expected_version / description
      Previous value: -"Latest version from file_get. Omit to append unconditionally. A mismatch writes nothing and returns status=conflict with current_version, current_body (file content), updated_by, and updated_at."New value: +"Latest version from file_get. Omit to append unconditionally. A mismatch writes nothing and returns status=conflict with file_id, current_version, updated_by, updated_at, total_chars, and a short preview. The live file body is not included."
  2. Changed1 schema field changed
    • addedInput schema / properties / expected_version
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Latest version from file_get. Omit to append unconditionally. A mismatch writes nothing and returns status=conflict with current_version, current_body (file content), updated_by, and updated_at."
      +}
  3. Changed1 schema field changed
    • changedInput schema / properties / content / description
      Previous value: -"New file body (markdown, raw HTML, teamshared.diagram/v1, or teamshared.sheet/v1 JSON/YAML)"New value: +"New file body (markdown, raw HTML, teamshared.diagram/v1 or teamshared.diagram/v2, or teamshared.sheet/v1 JSON/YAML)"
  4. Changed2 schema fields changed
    • changedInput schema / properties / content / description
      Previous value: -"New file body (markdown, raw HTML, or teamshared.diagram/v1 JSON/YAML)"New value: +"New file body (markdown, raw HTML, teamshared.diagram/v1, or teamshared.sheet/v1 JSON/YAML)"
    • changedInput schema / properties / content_format / description
      Previous value: -"Override content format ('markdown', 'html', or 'diagram'); defaults to the file's current format"New value: +"Override content format ('markdown', 'html', 'diagram', or 'sheet'); defaults to the file's current format"
  5. Changed2 schema fields changed
    • changedInput schema / properties / content / description
      Previous value: -"New file body (markdown or raw HTML)"New value: +"New file body (markdown, raw HTML, or teamshared.diagram/v1 JSON/YAML)"
    • changedInput schema / properties / content_format / description
      Previous value: -"Override content format ('markdown' or 'html'); defaults to the file's current format"New value: +"Override content format ('markdown', 'html', or 'diagram'); defaults to the file's current format"
  6. First observed

TDQS

A4.6/5.0
Behavior5/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 so: it discloses that a version mismatch writes nothing and returns status=conflict with file_id and a short preview rather than the body, that the retry path is re-read via file_get with offset/limit, that published files are eagerly mirrored to the Railway bucket, and that old versions are never mutated. These are exactly the behavioral traits an agent needs before invoking a mutation.

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 one-line purpose, then organized into concurrency, mirroring, and alternative-tool paragraphs. Slightly redundant where the conflict return payload is described in both the prose and the schema field, but no sentence is wasted.

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 5-parameter mutation tool with no annotations and an output schema, the description covers the safety model (no partial writes, immutable old versions), the error recovery loop, side effects on published files, and the sibling alternative. An agent has everything needed to call it correctly and handle failure.

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 100%, so the baseline is 3; the schema already documents expected_version's conflict response fields in as much detail as the description does. The description adds the operational strategy (source the value from file_get, purpose is to avoid overwriting a concurrent writer) but says nothing extra about content, content_format, or agent beyond 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 opening sentence gives a precise verb and resource (append a new version to an existing shared file) and the closing sentence names the sibling it is not (file_append), so an agent can distinguish the two without opening a schema. The append-only semantics are stated immediately.

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?

Explicitly covers the three decision points: omit expected_version for unconditional append, pass the version from file_get when editing a shared file to avoid clobbering a concurrent writer, and use file_append for appending a dated section to a large file rather than rewriting the body. When-to-use, when-not-to-use, and the alternative are all named.

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.