Skip to main content
Glama

ctx_diff

Return a semantic symbol diff between two git refs as JSON, listing added, modified, or removed symbols per file. Supply base to see only current branch changes via merge-base with HEAD.

Instructions

Return a semantic symbol diff between two git refs as JSON: the symbols added, modified or removed per file. Compared to ctx_changed, this is a structural (symbol-aware) diff rather than a file list. Provide base and head explicitly, or supply only base (or neither) — when base alone is given it resolves to its merge-base with HEAD so the diff shows only the current branch's changes; head defaults to HEAD. Only works in git repositories.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
baseNoBase git ref. Optional: if only base (or neither) is given, base resolves to its merge-base with HEAD, showing only the current branch's additions/modifications/removals. Defaults to HEAD.
headNoHead git ref to compare against base. Defaults to HEAD.
Behavior4/5

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

No annotations are provided, so the description carries the full behavioral burden. It discloses the result shape (added/modified/removed symbols per file), default ref resolution, merge-base behavior, and the git-repository precondition. It does not explicitly state read-only/no side effects or empty/error behavior, but 'diff' and 'Return' strongly imply a non-mutating read operation.

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

Conciseness5/5

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

Three sentences, front-loaded with the core purpose, then the sibling distinction, then invocation semantics and the key constraint. Every sentence earns its place and there is no redundant filler.

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?

For a tool with only two optional parameters, no output schema, and no annotations, the description communicates the result format, ref-resolution rules, and the git-only restriction. The unresolved 'or neither' case and lack of explicit side-effect or error behavior prevent a perfect completeness score, but overall the description is quite informative.

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

Parameters3/5

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

Schema coverage is 100%, so the parameters are already fully documented in the input schema. The description largely restates the same default and merge-base semantics without adding new parameter-level detail. The 'or neither' case remains ambiguous in both the schema and the description.

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 ('Return'), a clear resource ('semantic symbol diff between two git refs'), and the output format ('as JSON'). It also explicitly distinguishes itself from the sibling ctx_changed by framing this as a structural, symbol-aware diff rather than a file list, which removes ambiguity about what the tool does.

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?

Explicitly names ctx_changed as the alternative and explains the structural-vs-file-list distinction, giving agents a clear selection cue. It also provides practical guidance on supplying base/head and the merge-base behavior. The 'or neither' option is mentioned but not fully clarified, leaving some ambiguity about what happens when no refs are provided.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/halloffame12/CTX'

If you have feedback or need assistance with the MCP directory API, please join our Discord server