Skip to main content
Glama

Show what a run changed

opencode_diff

Retrieve the actual per-file patch for an opencode run via runId, revealing exact code changes rather than file names alone. Works within git repositories.

Instructions

Returns the actual patch per file for a run, not just the file names. Relies on opencode's workspace snapshots, so it is empty outside a git repository — opencode_result still lists the touched files in that case.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileNoOnly this file's patch.
runIdYesThe runId of the run.
maxCharsNoTruncate each patch (default 4000).
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses that the tool relies on workspace snapshots and returns empty results outside a git repository, which is important behavioral context. It stops short of explicitly stating it is read-only, but the read-only nature is implied and no contradictions exist.

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 sentences, front-loaded with the main purpose, followed by a necessary caveat. Every word earns its place; no redundancy or fluff.

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?

The description is complete for a tool with no output schema and no annotations: it explains the core functionality, the key limitation, and the relation to a sibling tool. It does not detail the patch format, but the term 'patch' is sufficiently clear for most users.

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 the baseline is 3. The description does not add extra parameter-level details beyond what the schema already provides, but it does clarify the output scope (actual patches vs file names).

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 clearly states the tool returns the actual patch per file for a run, which is specific and distinguishes it from opencode_result that lists file names. The verb 'returns' and resource 'patch per file' make the purpose unambiguous.

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

Usage Guidelines5/5

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

Explicitly contrasts with opencode_result ('not just the file names', 'opencode_result still lists the touched files'), indicating when to use this tool versus the sibling. Also provides a clear caveat about the git repository requirement.

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/teodorgross/opencode-mcp-bridge'

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