Skip to main content
Glama

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
NameRequiredDescriptionDefault
localPathYesThe local path of the project

Implementation Reference

  • 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}`); } }
  • 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'], }, },
  • 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) }], }; }

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/juho127/overleafMCP'

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