get_status
Retrieve Git repository status information using the specified absolute path to analyze changes and prepare for commit message generation.
Instructions
Gitのステータス情報を取得します
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Gitリポジトリの絶対パス |
Input Schema (JSON Schema)
{
"properties": {
"path": {
"description": "Gitリポジトリの絶対パス",
"type": "string"
}
},
"required": [
"path"
],
"type": "object"
}
Implementation Reference
- src/handlers/tools/getStatus.ts:5-43 (handler)Exports createGetStatusHandler function that returns the ToolHandler for 'get_status'. Includes name, description, inputSchema, and the async handler logic: validates 'path' arg, calls gitService.getStatus(path), returns JSON-formatted status as text content.export function createGetStatusHandler(gitService: GitService): ToolHandler { return { name: "get_status", description: "Gitのステータス情報を取得します", inputSchema: { type: "object", properties: { path: { type: "string", description: "Gitリポジトリの絶対パス" } }, required: ["path"] }, handler: async (args) => { try { if (!args || typeof args !== 'object' || !('path' in args) || typeof args.path !== 'string') { throw new McpError( ErrorCode.InvalidParams, "path parameter is required and must be a string" ); } const status = await gitService.getStatus(args.path); return { content: [{ type: "text", text: JSON.stringify(status, null, 2) }] }; } catch (error) { throw new McpError( ErrorCode.InternalError, `Failed to get git status: ${error}` ); } } }; }
- src/handlers/tools/getStatus.ts:9-18 (schema)Input schema definition for the get_status tool: object with properties {path: string (required)}.inputSchema: { type: "object", properties: { path: { type: "string", description: "Gitリポジトリの絶対パス" } }, required: ["path"] },
- src/handlers/toolHandlers.ts:10-13 (registration)Registers the get_status ToolHandler in the ToolHandlers class's internal Map during constructor initialization.this.handlers = new Map([ ['get_status', createGetStatusHandler(gitService)], ['create_commit', createCreateCommitHandler(gitService)] ]);
- src/services/gitService.ts:17-19 (helper)GitService.getStatus(path) method, which delegates to statusManager.getStatus(path). Called by the tool handler.async getStatus(path?: string) { return this.statusManager.getStatus(path); }
- src/index.ts:46-47 (registration)Dispatches 'get_status' tool calls to toolHandlers.handleGetStatus in the main server request handler.case "get_status": response = await toolHandlers.handleGetStatus(request.params.arguments);