Skip to main content
Glama

Connect GitOps repository

connect_gitops_repository
Destructive

Connect a GitOps repository to a cluster that has none: bind an existing GitHub credential plus a repository and branch - the same binding the portal's GitOps step creates. Pick the credential from list_gitops_credentials (pass credential_id, or credential_name when unambiguous) and the repository from list_gitops_repositories: it must be in the credential's synced repository list. On confirm the binding is written to the cluster's resource graph, a repository webhook is provisioned best-effort, the current cluster state is pushed to the repository as an initial commit, and a sync is nudged so the repository and the cluster record converge. Refused when the cluster is already connected to a DIFFERENT GitOps source: repointing prunes everything the new source does not define, so it stays on the cluster settings flow with its explicit acknowledgements. Re-connecting the identical repository and branch is safe and just refreshes the binding.

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": {
      "repository": "<repository>",
      "branch": "<branch>"
    },
    "name": "connect_gitops_repository"
  }
}

Input Schema

NameRequiredDescriptionDefault
branchYesThe branch the cluster's GitOps state lives on, e.g. main.
cluster_idNoCluster UUID. Optional when the chat is already scoped to a cluster.
repositoryYesThe repository's full name in owner/name form, e.g. ankraio/values.
credential_idNoUUID of the GitHub credential from list_gitops_credentials. Preferred over credential_name.
credential_nameNoName of the GitHub credential; refused when more than one credential shares the name.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Goes well beyond the destructiveHint=true annotation by enumerating the concrete side effects: binding written to the cluster's resource graph, best-effort webhook provisioning, an initial commit pushing current state to the repository, and a nudged sync. It also explains the destructive consequence of repointing ('prunes everything the new source does not define') and the refusal condition, which is exactly the context an agent needs before a mutation.

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?

The core action and its constraint are front-loaded in the first clause, and every sentence carries information. It is dense but long, and the final idempotency reassurance slightly restates the opening binding concept, costing some tightness.

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?

For a destructive, non-idempotent mutation with five parameters and no output schema, the description covers prerequisites, side effects, failure/refusal modes, and the safe re-connect case. An agent can decide and call correctly without further 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?

With 100% schema coverage the baseline is 3, but the description adds real constraints: credential_id is preferred over credential_name, credential_name only works when unambiguous, and the repository must appear in the credential's synced repository list. Those cross-field validation rules are not in the schema.

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 ('Connect a GitOps repository to a cluster') plus the exact binding it creates: an existing GitHub credential with a repository and branch. It also distinguishes itself from the cluster-settings repointing flow, so an agent can tell it apart from siblings like get_gitops_status or resolve_gitops_conflict without opening a 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 when-to-use ('a cluster that has none') and when-not ('Refused when the cluster is already connected to a DIFFERENT GitOps source ... stays on the cluster settings flow'), and names the prerequisite discovery tools list_gitops_credentials and list_gitops_repositories. It even clarifies the safe edge case of re-connecting the identical repository and branch.

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.