Skip to main content
Glama

push_changes

Commit and push LaTeX project changes from local machine to Overleaf using Git integration.

Instructions

Commit and push changes to Overleaf

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
localPathYesThe local path of the project
messageYesCommit message

Implementation Reference

  • Core handler implementing git add, status check, commit, and push logic for the push_changes tool.
    async pushChanges(localPath: string, message: string) { if (!await fs.pathExists(localPath)) { throw new Error(`Directory ${localPath} does not exist`); } const git: SimpleGit = simpleGit(localPath); try { await git.add('.'); const status = await git.status(); if (status.staged.length === 0 && status.created.length === 0 && status.modified.length === 0 && status.deleted.length === 0 && status.renamed.length === 0) { return { success: true, message: 'No changes to commit' }; } await git.commit(message); await git.push(); return { success: true, message: 'Pushed changes to Overleaf' }; } catch (error: any) { throw new Error(`Failed to push changes: ${error.message}`); } }
  • MCP CallToolRequest handler case that extracts arguments and delegates to gitManager.pushChanges.
    case 'push_changes': { const { localPath, message } = request.params.arguments as any; const result = await gitManager.pushChanges(localPath, message); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; }
  • src/index.ts:72-89 (registration)
    Tool registration in ListToolsRequestHandler, including name, description, and input schema.
    { name: 'push_changes', description: 'Commit and push changes to Overleaf', inputSchema: { type: 'object', properties: { localPath: { type: 'string', description: 'The local path of the project', }, message: { type: 'string', description: 'Commit message', }, }, required: ['localPath', 'message'], }, },
  • Input schema definition for the push_changes tool, specifying localPath and message parameters.
    inputSchema: { type: 'object', properties: { localPath: { type: 'string', description: 'The local path of the project', }, message: { type: 'string', description: 'Commit message', }, }, required: ['localPath', 'message'], },

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