Skip to main content
Glama

commit_changes

Destructive

Create or update a single file on a branch in one commit. Auto-detects file existence and handles creation or update.

Instructions

Create or update a single file on a branch in one commit.

Auto-detects whether the file exists:

  • File does not exist on the branch: Gitea returns 404 to the SHA lookup; we POST to create the file.

  • File exists: we use its current SHA and PUT to update it.

Returns Gitea's FileResponse shape (the resulting commit + content metadata). Raises :class:GiteaAPIError on conflicts (e.g. concurrent update changed the SHA between our lookup and our write — caller should re-read and retry).

Single-file only. Multi-file commits would require Gitea's Git Trees API and are deliberately out of scope for this tool.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ownerYesRepository owner
repoYesRepository name
branchYesBranch to commit to (must exist; use create_branch first)
pathYesFile path within the repository, e.g. 'README.md'
contentYesNew file content (UTF-8 text; binary files not supported)
messageYesCommit message

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

Annotations indicate destructive and non-read-only behavior. The description adds rich details: auto-detection of file existence, SHA-based updates, return of FileResponse, and conflict error raising. This goes beyond annotations to fully inform the agent of the tool's effects and edge cases.

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 concise (~150 words) and well-structured with bullet points. It front-loads the purpose and includes only relevant details (auto-detection, return type, error handling, scope). No superfluous information.

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?

Given the tool's complexity (6 required params, output schema exists), the description covers prerequisites (branch must exist), error handling (conflict retry), return type (FileResponse), and limitations (single-file only). The output schema provides return value details, so the description is complete for agent invocation.

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 description adds minimal parameter-specific detail beyond the schema (e.g., auto-detection is behavioral, not per-parameter). It marginally enriches understanding but does not significantly compensate beyond the schema's own 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 'Create or update a single file on a branch in one commit', providing a specific verb and resource. It distinguishes from siblings by explicitly noting that multi-file commits are out of scope and handled by Gitea's Git Trees API.

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 advises when not to use the tool (multi-file scenarios) and mentions prerequisites (branch must exist; use create_branch first via the branch parameter description). It also provides error handling guidance (re-read and retry on conflict). However, it does not explicitly compare to other sibling tools beyond the multi-file exclusion.

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/werebear73/gitea-mcp'

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