Skip to main content
Glama

Read session history

opencode_session_history
Read-only

Audit a session. Default detail='summary' returns only what a caller usually needs: the user prompt, the assistant's answers, token totals and a count of tools used — no tool arguments or outputs.

Instructions

Audit a session. Default detail='summary' returns only what a caller usually needs: the user prompt, the assistant's answers, token totals and a count of tools used — no tool arguments or outputs. detail='tools' adds one line per step (name and status; targets only with includeTargets=true). detail='full' is disabled for security unless the bridge was started with --allow-full-history. The full transcript is never sent by default.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "sessionID": "<sessionID>"
    },
    "name": "opencode_session_history"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoDefault 100
orderNo
cursorNoPagination cursor from a previous call
detailNosummary (default) | tools | full (admin-only, usually disabled)
formatNoDefault json
sessionIDYes
includeTargetsNodetail='tools': include a redacted path/command target per step (default false)
includeReasoningNoOnly with admin-enabled detail='full'

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv0.5.0
    • addedInput schema / properties / cursor / description
      Added value: +"Pagination cursor from a previous call"
    • addedInput schema / properties / detail
      Added value: +{
      +  "description": "summary (default) | tools | full (admin-only, usually disabled)",
      +  "enum": [
      +    "summary",
      +    "tools",
      +    "full"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / format / enum
      Previous value: -[
      -  "json",
      -  "markdown",
      -  "transcript"
      -]New value: +[
      +  "json",
      +  "markdown"
      +]
    • changedInput schema / properties / includeReasoning / description
      Previous value: -"Include reasoning blocks (default false)"New value: +"Only with admin-enabled detail='full'"
    • addedInput schema / properties / includeTargets
      Added value: +{
      +  "description": "detail='tools': include a redacted path/command target per step (default false)",
      +  "type": "boolean"
      +}
    • removedInput schema / properties / includeToolCalls
      Removed value: -{
      -  "description": "Include tool calls in rendered output (default true)",
      -  "type": "boolean"
      -}
  2. First observedv0.1.0

TDQS

A4.2/5.0
Behavior5/5

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

Annotations only say readOnlyHint=true, so the description carries the burden and does it well: it discloses that tool arguments and outputs are excluded from the default, that targets are redacted unless includeTargets=true, and that detail='full' is disabled unless the bridge was started with --allow-full-history. Those are behavioral and security facts an agent cannot get from the schema.

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

Conciseness4/5

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

The default behavior is front-loaded in the first two sentences, then modes, then the security gate. Slightly redundant that 'detail=full is disabled for security' and 'the full transcript is never sent by default' restate the same guarantee, but the repetition reinforces the safe default rather than wasting space.

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 an 8-parameter read tool with no output schema, the description explains the shape of what comes back at each detail level and which flags change that shape. It leaves pagination and limit semantics to the schema; a brief word on whether the summary spans the whole session or only the paged window would close the last gap.

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

Parameters4/5

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

With 75% schema coverage the baseline is already decent, yet the description adds meaning for the two most consequential flags: what includeTargets actually surfaces (a redacted path/command target per step) and the privilege requirement behind detail='full'. It is silent on limit, order, cursor and format, which the schema already documents.

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?

"Audit a session" gives a specific verb and resource, and the following sentences enumerate exactly what content each detail level returns. It does not name opencode_session_get or another sibling as the alternative, so differentiation is by content description rather than explicit routing.

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?

It clearly frames 'summary' as the default that covers what a caller usually needs, 'tools' as the escalation for per-step visibility, and 'full' as admin-gated. That is real guidance on choosing modes, though it never states when to prefer a sibling tool such as session_get instead of this one.

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