Skip to main content
Glama

create_or_update_file

Create or update files in GitHub repositories by providing content and commit messages, using SHA for updates to manage repository changes.

Instructions

Create or update a file in a repository. To update, you must provide the current file's SHA.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ownerYesRepository owner
repoYesRepository name
pathYesFile path in the repository
contentYesFile content (plain text, will be base64 encoded automatically)
messageYesCommit message
branchNoBranch name (defaults to default branch)
shaNoCurrent blob SHA of the file (required for updates, omit for new files)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses that updates require a SHA and creation does not, which is useful behavioral context. However, it does not mention permissions needed, rate limits, commit effects, or error handling, leaving gaps for a mutation tool with no annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences with zero waste, front-loaded with the core purpose and followed by a critical usage note. Every word serves a clear function, making it highly efficient and easy to parse.

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

Completeness4/5

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

Given the tool's complexity (mutation with 7 parameters) and no annotations, the description is somewhat complete but lacks details on permissions, side effects, or error cases. However, the presence of an output schema reduces the need to explain return values, and the description covers the key behavioral distinction between create and update operations.

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%, providing full parameter documentation. The description adds minimal value beyond the schema by implying the dual use of 'sha' for updates versus creation, but does not elaborate on parameter interactions or constraints beyond what's already in the schema descriptions.

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 description clearly states the specific action ('create or update a file in a repository') and resource ('file'), distinguishing it from siblings like 'delete_file', 'get_file_contents', or 'push_files'. It precisely defines the dual functionality in a concise manner.

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

Usage Guidelines4/5

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

The description provides clear context on when to use the update functionality ('you must provide the current file's SHA'), but does not explicitly mention when to use this tool versus alternatives like 'push_files' or 'create_repository' for broader operations. It offers some guidance but lacks explicit exclusions or sibling comparisons.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/software-engineer-mj/github-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server