Skip to main content
Glama

Compare versions

diff_branches
Read-onlyIdempotent

Show what changes from sourceBranch to targetBranch, as a line diff per file: - lines are sourceBranch's, + lines are targetBranch's, and each header names its version. To see what a version changed, pass the version it was made from as sourceBranch. Get ids from list_branches. A long diff comes a window of lines at a time: the answer says the offset to read on from.

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": {
      "sourceBranch": "<sourceBranch>",
      "targetBranch": "<targetBranch>",
      "offset": "<offset>",
      "limit": "<limit>",
      "projectId": "<projectId>"
    },
    "name": "diff_branches"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitYesMost lines on the page, 1 to 2000. null means 300.
offsetYeslines to skip: the offset the page before says to call again with. null starts at the first.
projectIdYesThe project this call runs on without changing the open project. null (or leaving it out) uses the open project. wait_for_jobs takes the projectId of the calls that started the jobs.
sourceBranchYes
targetBranchYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • addedInput schema / properties / limit
      Added value: +{
      +  "anyOf": [
      +    {
      +      "maximum": 2000,
      +      "minimum": 1,
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "Most lines on the page, 1 to 2000. null means 300."
      +}
    • addedInput schema / properties / offset
      Added value: +{
      +  "anyOf": [
      +    {
      +      "maximum": 9007199254740991,
      +      "minimum": 0,
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "lines to skip: the offset the page before says to call again with. null starts at the first."
      +}
    • changedInput schema / required
      Previous value: -[
      -  "sourceBranch",
      -  "targetBranch",
      -  "projectId"
      -]New value: +[
      +  "sourceBranch",
      +  "targetBranch",
      +  "offset",
      +  "limit",
      +  "projectId"
      +]
  2. First observed

TDQS

A4.3/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 safety is covered. The description adds genuinely new behavior: diff orientation convention, header naming, and paginated windowing where 'the answer says the offset to read on from' — useful for an agent driving a loop. It doesn't mention diff size limits or truncation caveats beyond paging.

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 compact clauses, front-loaded with the diff semantics and ending with the paging behavior an agent needs at call time. Slightly awkward phrasing ('A long diff comes a window of lines at a time') costs a little polish but no information is wasted.

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?

There is no output schema, so the description carries the return-format burden and does so: it explains the +/- convention, per-file headers, and the pagination continuation. Only gaps are error/edge behavior (identical branches, missing ids) which an agent might reasonably wonder about.

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 60%, with sourceBranch and targetBranch having no schema descriptions at all; the description compensates by defining directionality (source -> target) and how to pick a source for a single-version diff. It also reinforces the offset continuation contract that the schema hints at, adding loop semantics rather than repeating it.

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 ('show what changes from sourceBranch to targetBranch') and immediately defines the semantics of the output ('- lines are sourceBranch's, + lines are targetBranch's'). This clearly separates it from sibling tools like merge_branch, list_branches, and switch_branch.

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 guidance: 'To see what a version changed, pass the version it was made from as sourceBranch' and 'Get ids from list_branches.' It does not say when not to use this tool (e.g., versus reading a film or transcript), but the positive guidance is strong and actionable.

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.