Skip to main content
Glama

attach_git_remote

Attach a remote git repository to this project and optionally bind one of the user's own credentials: an SSH key (key_id from generate_ssh_key/add_ssh_key/list_ssh_keys) for ssh:// or git@host: addresses, or a GitHub/Gitee platform token for https:// addresses. Equivalent to the web app's git settings save. After attaching (and for public repos even without credentials), sync_from_git pulls the remote and push_git pushes to it. Only credentials owned by this user can be bound — referencing someone else's key_id fails as 'not found'.

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": {
      "project_id": "<project_id>",
      "remote_url": "<remote_url>"
    },
    "name": "attach_git_remote"
  }
}

Input Schema

NameRequiredDescriptionDefault
project_idYes
remote_urlYes
ssh_key_idNo
default_branchNomain
platform_token_idNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.4/5.0
Behavior4/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 well: it declares this is a configuration mutation, discloses the authorization constraint (only the user's own credentials can be bound; foreign key_id surfaces as 'not found'), and explains downstream effects on sync_from_git and push_git. It doesn't address re-attach/idempotency or whether existing settings are overwritten.

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

Conciseness4/5

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

Four dense sentences, front-loaded with the action and credential rules, with the authorization caveat last. No filler, though the parenthetical tool list is slightly heavy.

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

Completeness5/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 needn't be explained. Given a 5-parameter mutation with zero annotation coverage, the description supplies the credential model, authorization constraint, and follow-on workflow, which is enough for an agent to invoke it correctly.

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 0%, so the description must compensate and largely does: it ties ssh_key_id to the key-producing tools and to ssh/git@ URLs, ties platform_token_id to https URLs, and constrains remote_url by scheme. default_branch is never mentioned, and the description says 'key_id' rather than the actual parameter name 'ssh_key_id'.

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 ('Attach a remote git repository to this project') and immediately scopes the optional credential binding. It also positions itself relative to sync_from_git and push_git, so an agent can distinguish attaching configuration from performing sync/push operations.

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

Usage Guidelines4/5

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

Gives concrete routing rules: SSH key for ssh:// or git@host: addresses, platform token for https:// addresses, and it names the sibling tools that produce key_ids (generate_ssh_key/add_ssh_key/list_ssh_keys). It also notes the web-app equivalent and that public repos work without credentials. No explicit 'do not use when' case, which keeps it short of a 5.

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