Skip to main content
Glama

opencode_session_diff

Read-onlyIdempotent

Retrieve the diff of code changes for a session, optionally filtered to a specific message, to review what was modified.

Instructions

Get the diff for a session, optionally for a specific message

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesSession ID
directoryNoAbsolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory.
messageIDNoMessage ID (optional)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataNo
textYes
isErrorYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.0.0

TDQS

B3.3/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, so the safety profile is well covered. The description simply restates the action ('get') without adding behavioral context such as whether the diff is unified, whether it requires an active session, or any limits. It does not contradict annotations, but adds little beyond them.

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, direct sentence that conveys the core purpose without any filler. The optional message aspect is front-loaded after the main action, making it easy to parse. There is no wasted wording.

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?

The tool has an output schema, so return values are presumably documented there. The description is adequate for a simple read-only getter, but it does not explain what 'diff' means (e.g., format, scope) or any prerequisites such as session existence. Given the simplicity and existing annotations/schema, it is minimally sufficient but not rich.

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%, with each parameter (id, directory, messageID) already having a clear description. The tool description adds the note that the diff can be 'optionally for a specific message', which reinforces the messageID parameter but adds no new information. Since the schema carries the semantic load, a baseline of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get') and the resource ('diff for a session'), with an optional modifier for a specific message. It is specific and unambiguous, though it does not explicitly differentiate from sibling tools like opencode_session_get or opencode_message_get. The purpose is clear enough for an agent to understand what it does.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. Given the large set of sibling tools (e.g., opencode_session_get, opencode_message_get, opencode_session_children), an agent may not know when this diff-specific tool is appropriate. No exclusions or alternative suggestions are given.

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

Deploy Server

Other Tools