git_config
Set up or modify Git repository configurations by specifying the repository path, scope, and key-value pairs to adjust settings as needed.
Instructions
Configure git settings for the repository.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | Configuration key | |
| repo_path | Yes | The path to the local Git repository | |
| scope | No | Configuration scope (local, global, system) | local |
| value | Yes | Configuration value |
Implementation Reference
- src/handlers/config-operations.js:11-56 (handler)Core implementation of the git_config tool handler using simpleGit to set git configuration.export async function handleGitConfig({ repo_path, scope = "local", key, value, }) { try { const git = simpleGit(repo_path); // Set the configuration await git.addConfig(key, value, false, scope); return { content: [ { type: "text", text: JSON.stringify( { success: true, message: `Set ${scope} config ${key}=${value}`, key: key, value: value, scope: scope, }, null, 2 ), }, ], }; } catch (error) { return { content: [ { type: "text", text: JSON.stringify( { error: `Failed to set git config: ${error.message}` }, null, 2 ), }, ], isError: true, }; } }
- src/server.js:565-591 (schema)JSON Schema defining the input parameters and validation for the git_config tool.name: "git_config", description: "Configure git settings for the repository.", inputSchema: { type: "object", properties: { repo_path: { type: "string", description: "The path to the local Git repository", }, scope: { type: "string", description: "Configuration scope (local, global, system)", default: "local", enum: ["local", "global", "system"], }, key: { type: "string", description: "Configuration key", }, value: { type: "string", description: "Configuration value", }, }, required: ["repo_path", "key", "value"], }, },
- src/server.js:917-917 (registration)Registers the git_config tool name to its handler in the central handlersMap used for tool execution.git_config: handleGitConfig,
- src/handlers/index.js:76-76 (registration)Re-exports the handleGitConfig function from config-operations.js for use in server.js.handleGitConfig,
- src/server.js:876-876 (helper)Categorizes git_config under 'config' tools for organized listing and discoverability.config: ["git_config"],