pull_changes
Sync local LaTeX projects with Overleaf by pulling remote changes to maintain up-to-date files and prevent version conflicts.
Instructions
Pull latest changes from Overleaf for a local project
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| localPath | Yes | The local path of the project |
Implementation Reference
- src/git-manager.ts:55-67 (handler)Core handler function that performs the git pull operation on the specified localPath using simple-git library.async pullChanges(localPath: string) { if (!await fs.pathExists(localPath)) { throw new Error(`Directory ${localPath} does not exist`); } const git: SimpleGit = simpleGit(localPath); try { await git.pull(); return { success: true, message: 'Pulled latest changes' }; } catch (error: any) { throw new Error(`Failed to pull changes: ${error.message}`); } }
- src/index.ts:136-142 (handler)MCP CallToolRequest handler case for 'pull_changes' tool, which delegates to GitManager.pullChanges and formats the response.case 'pull_changes': { const { localPath } = request.params.arguments as any; const result = await gitManager.pullChanges(localPath); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; }
- src/index.ts:58-71 (registration)Tool registration in ListToolsRequestHandler, defining the tool name, description, and input schema (localPath required).{ name: 'pull_changes', description: 'Pull latest changes from Overleaf for a local project', inputSchema: { type: 'object', properties: { localPath: { type: 'string', description: 'The local path of the project', }, }, required: ['localPath'], }, },
- src/index.ts:61-71 (schema)Input schema definition for the 'pull_changes' tool, specifying the required 'localPath' parameter.inputSchema: { type: 'object', properties: { localPath: { type: 'string', description: 'The local path of the project', }, }, required: ['localPath'], }, },