Skip to main content
Glama

Models

opencode_model

List available models, read the default, and assign models per session, project, global config, or agent. Session assignment switches the API immediately; config edits preserve JSONC comments.

Instructions

List models, read the default, and assign models at four levels: session (immediate API switch), project (opencode.json in the workspace), global (~/.config/opencode/opencode.json), agent (agents..model). Session assignment wins for that conversation; project/global change the default for new sessions. Config edits preserve JSONC comments and are verified against model/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": {
      "action": "<action>"
    },
    "name": "opencode_model"
  }
}

Input Schema

NameRequiredDescriptionDefault
typeNoFilter for action=list
agentNoAgent id for scope=agent
modelNoRequired for action=set
scopeNoDefault: session when sessionID is given, otherwise project
actionYes
directoryNo
sessionIDNoFor scope=session

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

The single annotation readOnlyHint=false only signals that mutation is possible; the description adds real behavioral context beyond it, namely that config edits preserve JSONC comments and are verified against model/default, and that session changes are an 'immediate API switch.' However, it does not disclose permission requirements, whether config edits are reversible, or what happens on verification failure, so it remains a partial disclosure for a mutating tool.

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?

Front-loaded with the three actions before the scope detail, and every clause carries information. The parenthetical scope definitions make sentences dense and a table or list would read faster, but there is 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 7-parameter tool with a nested model object and no output schema, the description covers actions, scope semantics, precedence, and config-edit safety. Gaps remain around directory/type parameters and the shape of the list/default responses, but nothing required to invoke it correctly is missing.

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 coverage is 71%, so the baseline is 3. The description clarifies scope semantics and precedence that the schema only partially encodes, and ties scope=agent to 'agents.<id>.model'; but it says nothing about the type filter, directory, or model.variant, which are left entirely to the schema.

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?

States specific verbs and resources: 'List models, read the default, and assign models at four levels', mapping directly onto the action enum (list/default/set). It goes further by naming the four scopes it assigns at. It does not differentiate itself from any sibling, though no sibling appears to be a competing model tool, so the gap is minor.

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?

Explains the four scopes with concrete targets ('opencode.json in the workspace', '~/.config/opencode/opencode.json', 'agents.<id>.model') and states precedence: 'Session assignment wins for that conversation; project/global change the default for new sessions.' There is no explicit when-not guidance or note about which action to choose first, but the scope-selection context is clear.

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