Skip to main content
Glama

Git Set Working Directory

git_set_working_dir

Set the session working directory for git operations, allowing subsequent commands to omit path parameters.

Instructions

Set the session working directory for all git operations. This allows subsequent git commands to omit the path parameter and use this directory as the default.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesAbsolute path to the git repository to use as the working directory.
validateGitRepoNoValidate that the path is a Git repository.
initializeIfNotPresentNoIf not a Git repository, initialize it with 'git init'.
includeMetadataNoInclude repository metadata (status, branches, remotes, recent commits) in the response. Set to true for immediate repository context understanding. Defaults to false to minimize response size.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
successYesIndicates if the operation was successful.
pathYesThe working directory that was set.
messageYesConfirmation message.
repositoryContextNoRich repository metadata including status, branches, remotes, and recent history. Only included when includeMetadata parameter is true.
Behavior4/5

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

Discloses session-scoped statefulness ('session working directory') and side effects on subsequent commands, adding context beyond the readOnlyHint: false annotation. Does not contradict annotations. Could improve by explicitly stating this is temporary session state (not persistent across sessions) or detailing interaction with validateGitRepo/initializeIfNotPresent behaviors.

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?

Two well-structured sentences: first defines the action, second explains the benefit/behavioral consequence. Zero redundancy, front-loaded with critical information. Every word serves the agent's understanding.

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?

Adequate for a configuration tool with output schema present (handling return value documentation). Explains the mechanism of default path inheritance. Minor gap: does not mention error conditions (invalid paths) or explicitly scope the behavior to the current session only, though 'session' implies this.

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 schema fully documents all four parameters. The description references the 'path parameter' conceptually but does not add syntax details, validation rules, or semantic meaning beyond what the schema provides. Baseline score appropriate given schema completeness.

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?

Clearly states the tool sets a 'session working directory for all git operations' with specific verb (set) and resource (working directory). Effectively distinguishes from operational siblings (git_add, git_commit, etc.) by positioning this as session configuration rather than repository manipulation.

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?

Provides clear context on when to use by explaining it 'allows subsequent git commands to omit the path parameter.' Implicitly suggests use case for batch operations. Could be strengthened by explicitly contrasting with per-command path specification or mentioning git_clear_working_dir for cleanup.

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