Skip to main content
Glama

update_file

Create or update a file in a GitHub repository; supply the file path, commit message, content, and SHA when replacing an existing file.

Instructions

Create or update a file in a repository

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": {
      "owner": "<owner>",
      "repo": "<repo>",
      "path": "<path>",
      "message": "<message>",
      "content": "<content>"
    },
    "name": "update_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
shaNoOptional SHA of the file being replaced (required for updating existing files)
pathYesPath to the file
repoYesRepository name
ownerYesRepository owner
branchNoOptional branch name
contentYesFile content (Base64 encoded for binary files)
messageYesCommit message

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.2

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations, the description carries the full burden of behavioral disclosure, and it says only 'Create or update'. It doesn't disclose that a commit is created, what happens when sha is omitted or mismatched, whether changes overwrite or conflict, what permissions/auth are needed, or what the response contains.

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?

A single front-loaded sentence with no filler or redundancy. It is efficient, though its brevity borders on under-specification for a 7-parameter mutation tool.

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

Completeness2/5

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

Seven parameters with five required, no annotations, and no output schema make this a non-trivial mutation tool, yet the description omits side effects, the create-vs-update decision rule, default branch behavior, and failure modes. It is not complete enough for an agent to call confidently without reading the schema closely.

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 every parameter including sha, branch, content encoding, and message is already documented in the schema. The prose adds no parameter-level meaning beyond that, which is the expected baseline when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific resource (a file in a repository) and two operations (create, update), which lets an agent map it to a file-write action. However, it doesn't reconcile the dual create/update nature with the name 'update_file', and it never distinguishes itself from the sibling set (e.g. a file-write versus branch/issue/release creation).

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus alternatives, and no stated preconditions such as 'pass sha to update an existing file, omit it to create a new one' or which branch is targeted by default. The agent must reconstruct usage from the schema alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.