Skip to main content
Glama

sync_from_git

Pull the configured remote git repository into this project's workspace — the same chain as the web app's pull button. Use when the user has a local/remote git repository they want reflected in this cloud project: they push it to GitHub/Gitee once and attach it to the project (web app settings, or REST PUT /api/v1/user/git/projects/<project_id>/config with the same X-API-Key), then call this tool to sync — file bytes never flow through the model context, unlike write_file/upload_file. Check get_git_status first to see the attached remote and how far behind the project is. Requires no unsaved local edits. Public HTTPS repositories need no credentials; a private one needs a GitHub/Gitee platform token added in the web app (other hosts: an SSH address with an SSH key bound in the web app). reason token_required means anonymous access was refused: the host answers the same for a private repository and for a wrong address, so check the URL first. reason address_blocked means the remote's host resolves to a private/local network address the platform refuses to reach, and reason network_error means it did not resolve at all or in time — in both the remote IS configured, so do not re-attach it; check the address with the user instead. reason credential_mismatch means the credentials the remote is bound to (a platform token) do not belong to its host — the user has to re-bind them in the web app. reason timeout means the pull ran out of its time budget (a large repository or a slow network) — the remote IS configured and nothing is wrong with it, so tell the user to try again later rather than re-attaching. Two 403/400 answers from the config endpoint are part of the X-API-Key contract, not your mistake: 403 GIT_CREDENTIAL_BINDING_REQUIRES_WEB — the key may not choose the user's ssh_key_id/platform_token_id (attach the remote without them); 400 GIT_CREDENTIAL_MISMATCH_REQUIRES_WEB — a legacy row binds a platform token to a host it may not serve, and only the user can re-select it in the web app. A PUT response with credentials_dropped: true means the new address started without the old one's credentials (push_strategy_downgraded says which automatic strategy was turned back to manual) — tell the user to bind credentials in the web app before expecting pushes or private pulls. The first sync into a project nobody has changed since create_project replaces its starter files with the remote's default branch (sync before opening it in the web editor, whose AI panel moves it onto a session branch). reason unrelated_history means the project has history of its own — check the remote URL, or create a new project and sync into that.

Input Schema

NameRequiredDescriptionDefault
project_idYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and does so richly: it discloses that no file bytes flow through the model context, that the first sync replaces starter files with the remote's default branch, credential requirements per host type, and a detailed catalogue of failure reasons (token_required, address_blocked, network_error, credential_mismatch, timeout, unrelated_history) with guidance on whether the remote remains configured.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The core purpose is front-loaded well, but the body is a very long, dense run-on covering many error reasons with some repetition (repeated 'the remote IS configured' phrasing). Most content is useful, but it is over-sized and hard to scan.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists so return values need not be explained, and the description covers prerequisites, alternatives, side effects, and error handling comprehensively. The only real gap is that the single project_id parameter is never explicitly described.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0% and there is one parameter (project_id), whose meaning is only implied through repeated references to 'this project's workspace' and 'this cloud project'. The description doesn't explicitly state that project_id selects the sync target, but the intent is reasonably inferable from context.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource: pull the configured remote git repository into this project's workspace, equating it to the web app's pull button. It explicitly distinguishes itself from write_file/upload_file (no file bytes through model context) and routes to get_git_status for context, so an agent can tell it apart from siblings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives clear when-to-use ('user has a local/remote git repository they want reflected'), prerequisites (attach remote first via web app or REST PUT, no unsaved local edits, check get_git_status first), and explicit when-not guidance around re-attaching remotes for various error reasons.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources