Skip to main content
Glama
mcp-server-github

mcp-server-github

by DebuggingMax

create_or_update_file

Creates or updates a file in a GitHub repository by committing content to a specified branch, with support for replacing an existing file via its SHA.

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": "create_or_update_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
shaNoSHA of file being replaced (for updates)
pathYesFile path
repoYesRepository name
ownerYesRepository owner
branchNoBranch name
contentYesFile content (will be base64 encoded)
messageYesCommit message

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full behavioral burden and mostly drops it. It does not say this is a write that creates a commit on a branch, that it overwrites existing content, that updates require the current file SHA, or what happens on a SHA mismatch. For a mutation tool with zero annotation coverage, that is a significant gap.

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 short sentence, front-loaded with the verb and resource, with no filler. It earns its place but is terse to the point of omitting decision-relevant information, so it is efficient rather than exemplary.

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?

A seven-parameter mutation tool with no annotations and no output schema needs the description to explain commit semantics, the create/update split, and the SHA requirement. None of that is present, leaving the definition materially incomplete for its complexity.

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 all seven parameters are already documented and the baseline is 3. The description adds nothing beyond the schema, and notably does not clarify the inter-parameter dependency the schema leaves implicit: sha is optional in the required list but is effectively mandatory when replacing an existing file.

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?

Names a specific verb pair and resource: create or update a file in a repository. This is clearly distinguishable from the read-side sibling get_file_contents. It stops short of differentiating the two modes (create vs. update) that the name itself promises, which keeps it from a 5.

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 when-to-use guidance at all. It never says when the create path applies versus the update path, never points to get_file_contents as the way to obtain the SHA a replacement needs, and gives no prerequisites. An agent must infer the branching entirely.

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