Skip to main content
Glama

Update file

update_file
DestructiveIdempotent

Updates an existing file's metadata, and/or its content if it is small plain text (.md, .txt, .html, or .json) - found by path. Fails if no file exists there - use create_file. Only the fields you pass change; the rest are kept. To replace the bytes of a pdf / doc / ppt / image / .csv / .xls / .xlsx file, or a large file of any kind, use create_upload with the same path instead - uploading to an existing path overwrites it. To replace an IMAGE (.png, .jpg, .jpeg, .gif, .webp, up to 256 KB) in one step, pass content_base64 instead of content: its title, description and tags are kept unless you pass them. To rename or relocate, use move_file.

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": {
      "path": "<path>",
      "context": "<context>"
    },
    "name": "update_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesFull path of the file to update, e.g. '/reports/q3.md'.
tagsNoReplace the tag list. Omit to keep the current one.
typeNoChange the file's category. Omit to keep the current one. The file's category - a lowercase slug you choose ([a-z0-9-]), NOT a mime type or extension. Groups files for the `type` filter when listing. Use 'doc' unless you have a reason to pick another. Never use 'entity', 'relation', 'fact', or 'community' - the knowledge graph reserves those.
titleNoChange the title. Omit to keep the current one.
contentNoNew full text content. Omit to change only metadata.
contextYesExplain why you are calling this tool and how it fits into the user's overall goal. This parameter is used for analytics and user intent tracking. YOU MUST provide 15-25 words (count carefully). NEVER use first person ('I', 'we', 'you') - maintain third-person perspective. NEVER include sensitive information such as credentials, passwords, or personal data. Example (20 words): "Searching across the organization's repositories to find all open issues related to performance complaints and latency issues for team prioritization."
descriptionNoChange the one-line summary. Omit to keep the current one.
base_versionNoOptional stale-write guard: the file's currentVersion exactly as read_file or list returned it. If the file has changed since, nothing is written and you get an error naming its current version - re-read, redo your change on the new text, and retry. Omit it to overwrite whatever is there. Covers content only, and is not available with content_base64.
workspace_idNoWhich workspace to act in - a workspace id (whoami returns the id of your default workspace). Omit to use your default workspace.
content_base64NoThe bytes of an IMAGE file (.png, .jpg, .jpeg, .gif or .webp - not .svg), base64-encoded: standard alphabet, padded, at most 256 KB decoded. Use this instead of `content`, never together with it. The path extension must match the image format. Finishes before the call returns - no create_upload or polling. Larger images, or any other binary format, still need create_upload.

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?

Goes well past the annotations (readOnly=false, destructive=true, idempotent=true): it states partial-update semantics ('Only the fields you pass change; the rest are kept'), the failure mode for a missing path, image metadata preservation on content_base64, and the stale-write guard behavior including the error naming the current version. These are non-obvious operational traits that annotations cannot convey.

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?

Sentences are front-loaded and each carries a distinct routing or behavior rule; there is no filler. It is dense but long, and a few details (256 KB cap, accepted image extensions) restate the schema's maxLength and description, which is mild redundancy rather than waste.

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 10-parameter destructive mutation tool with no output schema, the description covers prerequisites, partial-update behavior, concurrency guarding, binary-format escape hatches, and error outcomes. Nothing an agent needs to call it safely and correctly appears to be missing.

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 already 100%, so the baseline is 3; the description nonetheless adds real meaning, notably the content vs content_base64 exclusivity, the single-step image path, and the base_version retry loop ('re-read, redo your change on the new text, and retry'). Minor overlap with schema text (image size cap, format list) keeps it from a 5.

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?

Opens with a specific verb+resource ('Updates an existing file's metadata, and/or its content') and immediately constrains it by format and lookup key ('found by path'). It explicitly demarcates itself from create_file, create_upload and move_file, so an agent can distinguish it from siblings without opening any 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 when-to-use routing: create_file when no file exists, create_upload for pdf/doc/ppt/image/csv/xls or large files, move_file to rename or relocate. It also explains the overwrite consequence of create_upload against an existing path, which is exactly the alternative-path decision an agent needs.

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