Skip to main content
Glama

Get a session's code changes

get_session_diff
Read-only

Retrieve the uncommitted changes a teammate attached to a shared session as a unified diff, so you can inspect exact code state and apply it with git apply.

Instructions

The uncommitted changes a teammate attached to a shared session, as a unified diff. Use it to see exact code state; to apply it, write it to a file and run git apply.

Input Schema

NameRequiredDescriptionDefault
idYesSession id
max_charsNoCut the diff at this many characters (default 100000)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.1.1
    • addedInput schema / properties / id / description
      Added value: +"Session id"
    • addedInput schema / properties / max_chars / description
      Added value: +"Cut the diff at this many characters (default 100000)"
  2. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true, so safety is covered; the description adds genuinely new context: the diff is uncommitted work authored by a teammate, it is a unified diff, and it is not applied by this tool. It does not describe truncation behavior, though max_chars in the schema covers that.

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?

Two short sentences with no filler; the core deliverable is stated first and the operational follow-up second. Every clause carries information.

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?

With no output schema, the description carries the return-value burden and does so by naming the format (unified diff). Minor gaps remain: behavior on a session with no attached changes, or on a missing/unauthorized session id, is not stated.

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 description coverage is 100%, so both `id` and `max_chars` (with range and default) are already documented in structured data. The description adds no syntax or format detail about either parameter, so baseline 3 applies.

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 precisely what is returned: the uncommitted changes attached to a shared session, in unified diff format. This is a specific resource plus an explicit output format, and it clearly separates the tool from siblings like get_session (metadata) and list_sessions.

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?

"Use it to see exact code state" gives a positive selection criterion, and the follow-up tells the agent exactly what to do with the result (write to file, `git apply`). It stops short of naming an alternative sibling or stating when not to use it, so it falls 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.