Skip to main content
Glama

bridge_apply_diff

Applies code changes from a worker’s isolated Git worktree branch into the main repository, then use the session cleanup tool to remove the temporary worktree.

Instructions

Apply the code changes generated by a worker in an isolated git worktree branch into the main repository. After applying, call bridge_close_session(session_id, cleanup_worktree=True) to clean up the temporary worktree.

Args: session_id: Session ID whose worktree branch should be applied. repo_root: Path to the target git repository (defaults to current directory).

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": {
      "session_id": "<session_id>"
    },
    "name": "bridge_apply_diff"
  }
}

Input Schema

NameRequiredDescriptionDefault
repo_rootNo
session_idYes

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.0.1

TDQS

A4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false, destructiveHint=false, idempotentHint=false and openWorldHint=false, so the safety profile is largely covered. The description adds that changes land in the main repository, but it does not explain what happens on merge conflicts, whether a failed apply leaves the repo dirty, or the consequences of running it twice on a non-idempotent operation.

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?

Front-loaded with the core action in the first sentence, followed by the required follow-up call and a compact Args block. Every sentence carries information; the only mild redundancy is restating the session_id meaning in the Args section.

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

Completeness3/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 annotations cover the mutation/safety profile. However, for a non-idempotent write into the main repository, the definition is silent on failure modes, conflict handling, and whether cleanup is mandatory, leaving gaps an agent would hit in practice.

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 description coverage is 0%—parameters have only titles—so the description must carry the burden, and it does: session_id is documented as the session whose worktree branch should be applied, and repo_root as the target repo path defaulting to the current directory. Both parameters are covered, though branch-selection or conflict-resolution options are absent.

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: applies code changes generated by a worker from an isolated git worktree branch into the main repository. Scope (worktree branch → main repo) is explicit, so an agent can distinguish it from sibling session-management tools like bridge_close_session or bridge_dispatch_task.

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 clear workflow context: it is the step that consumes a worker's generated changes, and it explicitly directs the caller to follow with bridge_close_session(session_id, cleanup_worktree=True). It does not state when not to use it or the preconditions (e.g., worker must have finished, session must be active), so it falls short of full routing guidance.

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