Skip to main content
Glama

Create a persistent OpenCode agent session

create_session

Start a persistent delegation session in a workspace without running a task yet. Follow up with send_message to keep the agent's context between calls.

Instructions

Create a persistent delegation session in a workspace without running a task yet. Follow up with send_message to keep the agent's context between calls.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwdYesWorkspace directory for the session.
agentNoAgent to use (default: deepseek-researcher). See list_agents.
modelNoOverride the model, e.g. "deepseek/deepseek-v4-pro".
titleNoHuman-readable session title.
allow_bashNoGrant (true) or revoke (false) shell commands for this session.
allow_editsNoGrant (true) or revoke (false) file edits for this session.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.1.0
    • addedInput schema / properties / allow_bash
      Added value: +{
      +  "description": "Grant (true) or revoke (false) shell commands for this session.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / allow_edits
      Added value: +{
      +  "description": "Grant (true) or revoke (false) file edits for this session.",
      +  "type": "boolean"
      +}
  2. First observedv1.0.0

TDQS

A4/5.0
Behavior3/5

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

Annotations only carry openWorldHint=true, so the description must carry behavioral load. It does disclose the central trait — the session is persistent and preserves context across calls — which is genuinely useful. But it says nothing about what the create returns, whether sessions expire, or the effect of the allow_bash/allow_edits permission grants beyond the schema's own wording.

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, zero filler, with the core purpose and the deferred-execution caveat front-loaded. Nothing could be cut without losing meaning.

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 create-only tool with no output schema and rich 100%-covered params, the description plus schema give an agent enough to invoke it correctly, including the follow-up pattern with send_message. It could be more complete by noting what happens to the session on subsequent calls or how sessions are terminated (abort_session), but nothing critical 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 description coverage is 100%, so every parameter (cwd, agent, model, title, allow_bash, allow_edits) is already documented in the schema. The description adds no syntax, format, or default information beyond that, so the baseline 3 applies.

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 and resource (create a persistent delegation session) and immediately scopes it with 'without running a task yet', which is the key distinction from the delegate_task sibling. An agent can tell from the description alone what this tool does and does not do.

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?

Explicitly prescribes the follow-up workflow: 'Follow up with send_message to keep the agent's context between calls.' This routes the agent to the right sibling and explains the reason (context retention). It does not state the inverse case (use delegate_task when you want to run a task immediately), so it stops short of full when/when-not coverage.

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