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

  • Executes the core logic of the push_changes tool: checks if local directory exists, stages all changes, checks for any changes via git status, commits with the message if changes present, pushes to Overleaf remote, handles errors.
    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}`); } }
  • src/index.ts:72-89 (registration)
    Registers the push_changes tool in the ListToolsRequestHandler response, defining its name, description, and input schema (localPath: string, message: string).
    { 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'], }, },
  • MCP CallToolRequest handler case for push_changes: parses arguments, delegates to GitManager.pushChanges, serializes and returns the result as text content.
    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) }], }; }

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