Skip to main content
Glama

Git Add

git_add

Stage files for commit by adding contents to the Git index. Select specific paths, stage all changes, or update only modified and deleted files before committing.

Instructions

Stage files for commit. Add file contents to the staging area (index) to prepare for the next commit.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNoPath to the Git repository. Defaults to session working directory set via git_set_working_dir..
filesNoArray of file paths to stage (relative to repository root). Use ["."] to stage all changes. Can be omitted when all or update is true.
updateNoStage only modified and deleted files (skip untracked files).
allNoInclude all items (varies by operation).
forceNoAllow adding otherwise ignored files.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
successYesIndicates if the operation was successful.
stagedFilesYesFiles that were successfully staged.
totalFilesYesTotal number of files staged.
statusYesRepository status after staging files.
Behavior3/5

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

Annotations indicate readOnlyHint: false, and the description adds context that this modifies the staging area/index rather than working directory files. However, it misses behavioral details like reversibility (can be undone with git_reset), error conditions, or the distinction between staging tracked vs untracked files.

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 consists of two efficient sentences with zero waste. The first sentence front-loads the core action ('Stage files'), and the second clarifies the mechanism ('Add file contents to the staging area').

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 presence of an output schema and 100% parameter coverage, the description adequately covers the core concept. It could be improved by mentioning the relationship to git_commit or common staging workflows, but it is sufficient for tool selection.

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?

With 100% schema description coverage, the baseline score is 3. The description mentions 'files' generally but adds no semantic detail about specific parameters like 'update' (modified/deleted only), 'all' (include untracked), or 'force' (ignored files) beyond what the schema already provides.

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 clearly states the tool stages files for commit and explains the staging area/index concept. It implies the workflow relationship with committing (distinguishing from git_commit), though it doesn't explicitly contrast with sibling tools like git_reset.

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

Usage Guidelines3/5

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

The phrase 'prepare for the next commit' implies this tool should be used before committing, providing minimal workflow context. However, it lacks explicit when-to-use guidance (e.g., 'use this to select specific changes') or when-not-to-use exclusions (e.g., 'do not use if you want to discard changes').

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/cyanheads/git-mcp-server'

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