Skip to main content
Glama

Inspect changes made in a session

get_diff
Read-only

Obtain file changes made in a delegated session, using OpenCode's diff or falling back to a git diff against the session baseline.

Instructions

Return the file changes associated with a delegated session: OpenCode's own session diff when available, otherwise a git diff against the baseline captured when the session was created.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
session_idYesSession id returned by delegate_task/create_session.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already provide readOnlyHint=true, and the description adds meaningful behavioral context by explaining the fallback from OpenCode's session diff to a git diff against the baseline. This goes beyond the annotation's safety signal, though it doesn't mention what happens when no diff exists.

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?

A single, front-loaded sentence that states the primary action first and then details the fallback. No filler or redundant 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?

For a one-parameter, read-only tool with no output schema, the description adequately explains what is returned and how the diff is sourced. Minor omissions, such as behavior when no diff is available, are acceptable given the tool's simplicity.

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%, and the schema already explains session_id as 'Session id returned by delegate_task/create_session.' The description does not add any further parameter semantics, so the baseline score of 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?

The description uses a specific verb ('Return'), names the resource ('file changes associated with a delegated session'), and specifies the diff-source fallback logic. This clearly distinguishes it from siblings like get_session, which deals with session metadata rather than file changes.

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?

The description clearly implies when to use the tool: to inspect file changes for a delegated session. The sibling list makes alternative purposes evident, but the description does not explicitly state exclusions or alternative tool names, 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.