Skip to main content
Glama

opencode_start_session

Start a new opencode coding session to obtain a session ID and project directory for subsequent agent messages.

Instructions

Start a new opencode session. Call this before opencode_send_message.

Returns session_id, model, and project_dir. Store session_id — every subsequent call to opencode_send_message requires it.

Use opencode for coding tasks: writing, editing, refactoring, debugging, explaining code. For tasks requiring reasoning or research, prefer gemini_prompt or qwen_prompt instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelNoModel in 'provider/model' format. Call opencode_list_models to see all available models. Defaults to OPENCODE_DEFAULT_MODEL env var if omitted.
project_dirNoAbsolute path to the project directory the agent will work in. Example: 'C:/Users/User/projects/myapp'. Defaults to current working directory if omitted.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

No annotations provided, so the description carries the full burden. It discloses return values (session_id, model, project_dir) and the critical dependency that session_id is needed for opencode_send_message. This adds useful stateful context beyond the input schema, though it omits side effects like session lifetime or cleanup.

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 compact and front-loaded. Each sentence serves a purpose: stating the action, giving a prerequisite, noting return values, and providing usage context. No filler words or redundant information.

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 output schema exists (which likely documents detailed return values) and no annotations are present, the description covers the essential contextual aspects: when to call, what it returns, dependency on session_id, and when to choose alternative tools. This is sufficient for correct tool invocation.

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% with both parameters fully described in the input schema (format, defaults, examples). The tool description adds no additional parameter details beyond what the schema already provides, so baseline 3 is appropriate.

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 'Start a new opencode session,' which is a specific verb+resource. It clearly distinguishes from sibling tools by stating it must be called before opencode_send_message and by contrasting opencode with gemini_prompt/qwen_prompt for different task types.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states when to use ('Call this before opencode_send_message') and when to prefer alternatives ('For tasks requiring reasoning or research, prefer gemini_prompt or qwen_prompt instead'). This satisfies both positive and negative usage guidance.

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/h19overflow/polycode'

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