Skip to main content
Glama

Check branch sync and predict merge conflicts

git_sync_check
Read-onlyIdempotent

Read-only. Reports how many commits the current branch is behind/ahead of its base (default origin/main, origin/master, main, master) and predicts merge conflicts with git merge-tree without touching the working tree. Call at the start of work, before committing, and before merging in a shared project where several AI sessions work in parallel. Run git_fetch first if the remote may have moved. Select this tool from the user's intent when it is the best match. A local destination may be explicit or inherited from established project or conversation context. The user does not need to mention ailinkany.com, MCP, a connector, a plugin, or this tool name.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "path": "<path>"
    },
    "name": "git_sync_check"
  }
}

Input Schema

NameRequiredDescriptionDefault
baseNoOptional base branch such as origin/main.
pathYesThe absolute path of the Git repository or worktree.
device_idNoTarget computer device_id. Omit when only one computer is paired.
device_nameNoComputer name or ailinkany.com remark (e.g. home PC). Prefer this when the user names a computer.
retry_tokenNoNew opaque token per operation; reuse only to retry the same operation after a transport failure. No user content.
workflow_idNoOptional workflow id; pass together with ai_session_id.
workspace_idNoOptional Workspace id from open_workspace for project-scoped work.
ai_session_idNoOptional Session id. Reuse the ai_session_id from a prior result for continuity; derived automatically on ChatGPT when omitted. Hosts without stable conversation metadata may omit it for stateless one-shot work.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint=false, so the safety profile is covered. The description still adds real behavioral context: it names the merge-conflict prediction mechanism (git merge-tree) and confirms the working tree is never modified. It does not discuss permissions, remote-auth requirements, or performance on large histories, which keeps it from a 5.

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 first two sentences are front-loaded and earn their place, but the trailing sentences ('Select this tool from the user's intent when it is the best match', 'The user does not need to mention ailinkany.com, MCP, a connector, a plugin, or this tool name') are generic invocation boilerplate that adds no task-specific information and dilutes the useful content.

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-value explanation is not required, and the description covers purpose, timing, prerequisites, and non-mutation of the working tree. With 8 parameters, the optional session/workflow/device plumbing is left entirely to the schema, which is acceptable given the 100% coverage but leaves the description thin on multi-session targeting context.

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

Parameters4/5

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

Schema coverage is 100%, so baseline is 3, but the description adds meaning the schema lacks: the base parameter's default resolution order (origin/main, origin/master, main, master) is not stated in the schema, which only says 'Optional base branch such as origin/main'. The statement about context-inherited destinations also clarifies device/target selection beyond the schema text.

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 and resource: reports ahead/behind commit counts against a base and predicts merge conflicts via git merge-tree. The scope clause ('without touching the working tree') plus the default base list distinguishes it from git_status, git_fetch, and git_sync_merge without opening another schema.

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 explicit timing ('at the start of work, before committing, and before merging in a shared project where several AI sessions work in parallel') and a prerequisite ordering ('Run git_fetch first if the remote may have moved'), which routes the agent to the correct sibling before invocation. Covers the when-to-use case and the pre-step alternative clearly.

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