Skip to main content
Glama

OpenCode Session Depot

opencode_depot
Destructive

Manage and search opencode session archives: list, inspect, archive, restore, rename, delete, full-text search, semantic RAG, and code-recall. Reads SQLite depot directly.

Instructions

Session depot: list, inspect, archive/unarchive, rename, delete, search transcripts, semantic RAG search, code-recall search, or stats.

Reads opencode's SQLite depot directly - works without opencode serve. Archive/unarchive/rename are reversible; delete is permanent (FK cascade). search = exact/full-text wayback find; rag = semantic similarity over indexed transcripts; code = when an agent touched a file (patch paths + edit tool inputs), by path or by content. rag/code need uv sync --extra rag and an index pass (rag_index indexes both).

Return Format

{"success": bool, "message": str, "data": dict}

Examples

opencode_depot(action="list", status="archived", limit=20) opencode_depot(action="unarchive", session_id="sess_01") opencode_depot(action="search", query="power limit") opencode_depot(action="rag", query="what did we decide about the power limit") opencode_depot(action="code", path_filter="auth_utils.py") opencode_depot(action="code", query="extracted the auth module", path_filter="src") opencode_depot(action="rag_index") opencode_depot(action="stats")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sortNoSort order (list)updated
agentNoAgent name filter (list)
limitNoPage size (list/search/rag/code)
queryNoSearch text (search/rag/code)
titleNoNew title (rename)
actionYeslist: sessions with filters. get: one session with counts. archive: hide from active list. unarchive: restore (missing in opencode UI). rename: set title. delete: permanently remove (cascades messages). search: full-text across transcripts and titles (wayback find). rag: semantic search over indexed transcripts (needs rag extras). rag_index: index new sessions for semantic search (text + code). rag_status: index state + availability. code: find WHEN an agent touched a file - by path (path_filter only) or by content (query): patch paths + edit tool inputs from every session. code_index: rebuild the code table from all sessions (code-only backfill). code_status: code index state. stats: aggregate cost/tokens by agent/project.
offsetNoPage offset (list)
searchNoTitle substring filter (list)
statusNoStatus filter (list): all, active, or archivedall
projectNoProject/directory substring filter (list)
session_idNoSession ID (required for get/archive/unarchive/rename/delete)
path_filterNoFile path substring (code): only rows whose path contains this

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

Beyond the annotations (readOnlyHint=false, destructiveHint=true), the description adds critical behavioral detail: 'Archive/unarchive/rename are reversible; delete is permanent (FK cascade).' It also explains the semantic differences between search, rag, and code, and the indexing prerequisites. This is substantial context that annotations alone do not provide.

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?

The description is dense but well-structured: a one-line action summary, focused bullet points on behavior, a clear return format block, and practical examples. Every line earns its place without redundancy or fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (14 actions, 12 parameters), the description covers all main usage modes, dependencies (e.g., `uv sync --extra rag`), side effects (permanent delete), and a return format. The output schema already exists, so detailed return fields are unnecessary in the description. This is complete for a tool of this scope.

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?

Schema coverage is 100%, so the baseline is 3. The description adds value by showing concrete example parameter combinations (e.g., opencode_depot(action='code', query='extracted the auth module', path_filter='src')) and by explaining how parameters like `path_filter` and `query` are used differently in the code action. This goes beyond the schema descriptions.

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 opens with a clear enumeration of actions: 'list, inspect, archive/unarchive, rename, delete, search transcripts, semantic RAG search, code-recall search, or stats.' It also distinguishes the tool from siblings by stating 'Reads opencode's SQLite depot directly - works without `opencode serve`.' This makes the resource and scope unambiguous.

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 provides strong usage context: direct DB access without the server, and ample guidance on choosing between actions (search vs rag vs code). It also flags setup requirements: 'rag/code need `uv sync --extra rag` and an index pass.' However, it does not explicitly name alternative sibling tools or state when NOT to use this tool, so it stops 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.

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/sandraschi/opencode-cli-mcp'

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