Skip to main content
Glama

Configure OpenCode connection

opencode_configure

Set or repair the OpenCode server address and password from inside the chat, with values validated before applying. Credentials stay in memory unless persist is enabled.

Instructions

Set or repair the OpenCode v2 server address and password from inside the chat. The values are validated against GET /api/info before they are applied; nothing changes on failure. The password is never echoed back, is kept in memory by default, and is only written to disk when persist=true. Prefer configuring OPENCODE_URL and OPENCODE_PASSWORD in the MCP client settings when possible.

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_configure"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlNoOpenCode server address, e.g. http://127.0.0.1:4096
testNoValidate and report, without applying
clearNoForget runtime credentials
persistNoWrite the values to the 0600 config file (default false)
passwordNoOpenCode Basic-auth password (username is always 'opencode')
removeFileNoWith clear=true, also delete the stored config file

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

With annotations covering only write/safety hints, the description carries real behavioral weight: validation against GET /api/info happens before apply, nothing changes on failure (atomicity), the password is never echoed, and persistence is opt-in via persist=true with in-memory as the default. That is well beyond what readOnlyHint=false and destructiveHint=false convey.

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?

Four short sentences, each load-bearing, front-loaded with the purpose and followed by validation, secrecy/persistence, then the alternative. No restated field names and no filler.

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 6-parameter, zero-required, no-output-schema configuration tool, it covers the risky parts an agent needs: validation, failure safety, secret handling, and persistence. The remaining gap is that no output schema exists and the description never says what a test=true call returns, so an agent cannot anticipate the response shape.

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 description coverage is 100%, so the baseline is 3, but the prose adds policy meaning the schema does not: the password is not echoed back, memory-only is the default, and disk writes are conditional on persist=true. It does not explain test=true reporting behavior or the clear/removeFile pairing, leaving some parameter interactions to the schema alone.

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 names a specific verb pair and resource: 'Set or repair the OpenCode v2 server address and password'. It also scopes the action ('from inside the chat'), which cleanly separates it from every session/agent/model sibling, none of which touch connection credentials.

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 explicitly steers the agent toward MCP client settings (OPENCODE_URL / OPENCODE_PASSWORD) as the preferred route and frames this tool as the fallback for setting or repairing a connection. What is missing is an explicit trigger condition (for example, first-run setup or a failing connection), so the when-to-invoke decision is still partly inferred.

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