get_status
Check git status and view differences for local Overleaf LaTeX projects to track changes before syncing with the cloud.
Instructions
Get the status of the local project (git status and diff)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| localPath | Yes | The local path of the project |
Implementation Reference
- src/git-manager.ts:90-106 (handler)The handler function that implements the core logic of the 'get_status' tool by checking if the directory exists, running git.status() and git.diff('--stat'), and returning the results.async getStatus(localPath: string) { if (!await fs.pathExists(localPath)) { throw new Error(`Directory ${localPath} does not exist`); } const git: SimpleGit = simpleGit(localPath); try { const status = await git.status(); const diff = await git.diff(['--stat']); return { success: true, status: status, diff: diff }; } catch (error: any) { throw new Error(`Failed to get status: ${error.message}`); } }
- src/index.ts:93-102 (schema)Input schema definition for the 'get_status' tool, requiring a 'localPath' string parameter.inputSchema: { type: 'object', properties: { localPath: { type: 'string', description: 'The local path of the project', }, }, required: ['localPath'], },
- src/index.ts:90-103 (registration)Registration of the 'get_status' tool in the MCP server's tool list, including name, description, and input schema.{ name: 'get_status', description: 'Get the status of the local project (git status and diff)', inputSchema: { type: 'object', properties: { localPath: { type: 'string', description: 'The local path of the project', }, }, required: ['localPath'], }, },
- src/index.ts:150-156 (helper)Dispatcher/helper code in the CallToolRequestHandler that invokes the getStatus method on gitManager instance and formats the response.case 'get_status': { const { localPath } = request.params.arguments as any; const result = await gitManager.getStatus(localPath); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; }