Skip to main content
Glama

Resolve workspace directory

opencode_workspace

Report the working directory OpenCode sessions will use, show where that setting came from, or persist a new default before creating a session.

Instructions

Report which directory sessions will use, where that choice came from (argument, MCP roots, env, config, cwd), or persist a new default. Use this before creating a session when you are unsure about the working directory.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "opencode_workspace"
  }
}

Input Schema

NameRequiredDescriptionDefault
actionNoDefault: info
directoryNoAbsolute path (required for set-default)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations only declare readOnlyHint=false; the description supplies the crucial nuance that two modes are read-only reporting while 'set-default' persists state, so the agent knows the tool can mutate configuration. The enumeration of resolution precedence order is genuinely useful context not present in the schema or annotations, though reversibility of set-default (how to undo a persisted default) is not addressed.

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, fully front-loaded with the primary behavior, and every clause carries information (resolution sources, second mode, usage trigger). No filler or restatement of the tool name.

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 two-parameter tool with no output schema, it covers what is reported (directory plus its origin), the write mode, and when to call it. The only gap is that 'list-roots' behavior and the exact resolution precedence (as opposed to an unordered source list) are left implicit.

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 documents the action enum and that directory is required for set-default, so the description's mention of 'argument' and 'persist a new default' largely mirrors it. The description does not explain the 'list-roots' action, leaving one enum value with meaning only from its name.

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?

States a specific verb+resource pair ('Report which directory sessions will use') plus a second mode ('persist a new default'), and enumerates the resolution sources (argument, MCP roots, env, config, cwd). It is clearly distinguishable from the session_* siblings, which act on sessions rather than the workspace root.

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?

Gives an explicit trigger condition: 'Use this before creating a session when you are unsure about the working directory.' That is a clear when-to-use, though it does not state when not to use it or name a sibling alternative for directory-changing scenarios (e.g., opencode_session_move for an already-created session).

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