Skip to main content
Glama

session_create

Creates an OpenCode session in a specified working directory on a chosen server, with optional model, agent, title, and gated write access; omit the server when only one is available.

Instructions

Create a session on one server. Omit the server argument when exactly one server is available.

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": {
      "directory": "<directory>"
    },
    "name": "session_create"
  }
}

Input Schema

NameRequiredDescriptionDefault
agentNoAgent name to use.
modelNo
titleNoSession title.
serverNoServer id. Omit when exactly one server is available.
allowedNoAllow write operations (gated).
directoryYesWorking directory for the session.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A3.5/5.0
Behavior3/5

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

Annotations already declare this is a non-readonly, non-destructive, non-idempotent, closed-world mutation, so the safety profile is largely covered. The description adds only the server-resolution rule and says nothing about what happens when 'allowed' is false (write gating), whether duplicate calls create duplicate sessions, or what a caller gets back.

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, front-loaded with the action and immediately followed by the only non-obvious invocation rule. Nothing is wasted.

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

Completeness3/5

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

For a six-parameter mutation with a nested model object and no output schema, the definition is thin: it never mentions the gated 'allowed' flag, defaults for agent/model/directory, or what identifier the caller needs to continue with session_prompt or session_get. Adequate to invoke, insufficient to invoke confidently.

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 83%, so the baseline is 3. The one behavioral note in the description (omit server when exactly one exists) merely restates the schema text for the server parameter, adding no meaning beyond 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?

"Create a session on one server" names a concrete verb and resource, and the scoping phrase "on one server" hints at the resource model that separates it from the read-oriented session_* siblings. It does not explicitly contrast with a sibling such as session_get or sessions_list, so differentiation is implied rather than stated.

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

Usage Guidelines3/5

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

The single conditional "Omit the server argument when exactly one server is available" gives real usage guidance for one parameter. There is no guidance on when to create a session versus using an existing one, nor any prerequisite/authorization context.

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