Skip to main content
Glama

status

Read-only

Retrieve the current status of a Git repository, including staged changes, untracked files, branch details, and stash information, using customizable parameters for detailed or concise output.

Instructions

Get the current git repository status.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aheadBehindNoDisplay detailed ahead/behind counts relative to upstream branch (--ahead-behind, --no-ahead-behind)
branchNoShow the branch and tracking info even in short-format (-b, --branch)
columnNoDisplay untracked files in columns (--column[=<options>], --no-column)
findRenamesNoTurn on rename detection, optionally set similarity threshold (--find-renames[=<n>])
ignoreSubmodulesNoIgnore changes to submodules (--ignore-submodules[=<when>])
ignoredNoShow ignored files as well (--ignored[=<mode>])
longNoGive the output in the long-format (--long, default)
pathspecNoLimit the output to the given paths
renamesNoTurn on/off rename detection (--renames, --no-renames)
repoPathYesAbsolute path to the git repository
shortNoGive the output in the short-format (-s, --short)
showStashNoShow the number of entries currently stashed away (--show-stash)
untrackedFilesNoShow untracked files (-u[<mode>], --untracked-files[=<mode>])
verboseNoShow textual changes that are staged to be committed (-v, --verbose, can be specified twice)

Implementation Reference

  • The core handler function (#handle) that executes the git status command using simple-git, checks if it's a repo, and returns the status as JSON.
    readonly #handle: ToolCallback<typeof GIT_STATUS_INPUT_SCHEMA> = async (input) => {
    	const sg = simpleGit(input.repoPath);
    
    	const isRepo = await sg.checkIsRepo();
    	if (!isRepo) {
    		return {
    			isError: true,
    			content: [
    				{
    					type: 'text',
    					text: 'Not a git repository',
    				},
    			],
    		};
    	}
    
    	const status = await sg.status(this.inputToOptions(input));
    
    	return {
    		content: [
    			{
    				type: 'text',
    				text: 'Git status retrieved successfully',
    			},
    			{
    				type: 'text',
    				text: JSON.stringify(status),
    			},
    		],
    	};
    };
  • Zod input schema (GIT_STATUS_INPUT_SCHEMA) defining all parameters for the git status tool, mirroring git status options.
    export const GIT_STATUS_INPUT_SCHEMA = {
    	repoPath: z.string().describe('Absolute path to the git repository'),
    	short: z.boolean().optional().describe('Give the output in the short-format (-s, --short)'),
    	branch: z.boolean().optional().describe('Show the branch and tracking info even in short-format (-b, --branch)'),
    	showStash: z.boolean().optional().describe('Show the number of entries currently stashed away (--show-stash)'),
    	long: z.boolean().optional().describe('Give the output in the long-format (--long, default)'),
    	verbose: z
    		.union([z.boolean(), z.number().int().min(0).max(2)])
    		.optional()
    		.describe('Show textual changes that are staged to be committed (-v, --verbose, can be specified twice)'),
    	untrackedFiles: z
    		.union([z.boolean(), z.enum(['no', 'normal', 'all'])])
    		.optional()
    		.describe('Show untracked files (-u[<mode>], --untracked-files[=<mode>])'),
    	ignoreSubmodules: z
    		.enum(['none', 'untracked', 'dirty', 'all'])
    		.optional()
    		.describe('Ignore changes to submodules (--ignore-submodules[=<when>])'),
    	ignored: z
    		.union([z.boolean(), z.enum(['traditional', 'no', 'matching'])])
    		.optional()
    		.describe('Show ignored files as well (--ignored[=<mode>])'),
    	aheadBehind: z
    		.boolean()
    		.optional()
    		.describe('Display detailed ahead/behind counts relative to upstream branch (--ahead-behind, --no-ahead-behind)'),
    	renames: z.boolean().optional().describe('Turn on/off rename detection (--renames, --no-renames)'),
    	findRenames: z
    		.union([z.boolean(), z.number().int().min(0).max(100)])
    		.optional()
    		.describe('Turn on rename detection, optionally set similarity threshold (--find-renames[=<n>])'),
    	column: z
    		.union([z.boolean(), z.string()])
    		.optional()
    		.describe('Display untracked files in columns (--column[=<options>], --no-column)'),
    	pathspec: z.array(z.string()).optional().describe('Limit the output to the given paths'),
    };
  • The register method of GitStatusTool that calls srv.registerTool with the tool name 'status', config, and handler.
    register(srv: McpServer) {
    	srv.registerTool(this.name, this.config, this.#handle);
    }
  • Instantiation and registration of the GitStatusTool on the MCP server.
    new GitStatusTool().register(server);
  • Getter that returns the tool name as 'status'.
    get name() {
    	return 'status';
    }
Behavior3/5

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

Annotations declare readOnlyHint=true, which the description aligns with by using 'Get' (a read operation). The description doesn't add significant behavioral context beyond what annotations provide - it doesn't mention output format, performance characteristics, or error conditions. However, it doesn't contradict the annotations either.

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 a single, efficient sentence that immediately communicates the core function. There's zero wasted verbiage - every word earns its place. It's perfectly front-loaded with the essential information.

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

Completeness3/5

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

For a read-only tool with excellent schema coverage (100%) and clear annotations, the description is minimally adequate. However, without an output schema, the description doesn't help the agent understand what the status output looks like or what information it contains. The description could better prepare the agent for interpreting results.

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 input schema thoroughly documents all 14 parameters. The description adds no parameter information beyond the schema, which is acceptable given the comprehensive schema coverage. The baseline of 3 is appropriate 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 clearly states the verb ('Get') and resource ('current git repository status'), making the purpose immediately understandable. It doesn't distinguish from siblings like 'log' or 'diff' which also provide repository information, but it's specific enough to understand the core function.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when this tool is appropriate compared to siblings like 'log' (history) or 'diff' (changes), nor does it provide any context about prerequisites or typical use cases.

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

Related 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/ver0-project/mcps'

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