Skip to main content
Glama

Create a persistent OpenCode agent session

create_session

Set up a persistent delegation session in a workspace before running tasks, keeping the agent's context available across follow-up messages.

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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.1/5.0
Behavior4/5

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

Beyond the minimal openWorldHint annotation, the description discloses meaningful behavior: the session is persistent, no task runs on creation, and the agent's context is retained between calls when used with send_message. This adds real behavioral context beyond what the structured annotation provides.

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 with zero filler. The core purpose and scope are front-loaded in the first sentence, and the second sentence earns its place by explaining the interaction protocol with send_message.

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 simple create operation with a fully documented schema, the description is mostly sufficient. However, with no output schema and an openWorldHint, it would help to state what the call returns (e.g., a session identifier to use with send_message) and any workspace requirements, so an agent is left with a small gap about the response.

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 the input schema already documents all four parameters. The description adds no parameter-level meaning, so the baseline of 3 applies; nothing is missing, but nothing extra is contributed either.

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 states a specific action (create), a specific resource (persistent delegation session in a workspace), and a critical constraint ('without running a task yet'). This last phrase directly distinguishes it from the sibling delegate_task, so an agent can tell the tools apart without opening schemas.

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?

The description gives a clear workflow context: create the session first, then follow up with send_message to keep the agent's context across calls. It does not explicitly name delegate_task as the alternative for one-shot task execution or state when not to use this tool, so it stops short of full when/when-not guidance.

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