Skip to main content
Glama

Close a market session

close_session
DestructiveIdempotent

End an open session to free memory and return each agent's final portfolio plus all orders sent, enabling exact re-runs from open_session. The session and checkpoints are then removed.

Instructions

Close an open session and free its memory, returning each agent's final portfolio and every order sent on the session's line, which is what re-runs it from open_session. The session and its checkpoints are gone afterwards. Runs no market.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
session_idYesA session id exactly as open_session or session_fork returned it.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.10.1

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, idempotentHint=true, and openWorldHint=false, so the safety profile is partly covered. The description adds non-obvious specifics the annotations do not: the session's checkpoints are destroyed along with it, and it 'runs no market,' which meaningfully distinguishes its behavior from the simulation-oriented siblings.

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?

Two dense sentences with the destructive consequence front-loaded and no filler. The clause 'which is what re-runs it from open_session' is slightly convoluted, keeping it just below the ideal.

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?

Behavior, destruction scope, and side-effect profile are all covered, and an output schema exists so return-value detail is not required. The description nonetheless restates return contents, which is redundant rather than missing, and it never clarifies idempotency semantics for re-closing an already-closed session.

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?

There is a single session_id parameter with 100% schema description coverage, so the schema already carries the semantics. The description adds nothing about the id's format or origin beyond what the schema states, which is the expected baseline 3 when the schema does the heavy lifting.

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 (close) and resource (an open session) and spells out the effect: freeing memory, returning final portfolios and orders. It explicitly frames itself against the sibling open_session ('what re-runs it from open_session'), so an agent can place it in the session lifecycle without opening the schema.

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 makes clear this is the terminal counterpart to open_session and that the returned data is what you feed back into open_session for a re-run, which gives genuine context for when to call it. It stops short of explicit when-not guidance or naming other session siblings (session_fork, session_rewind) as alternatives, so it does not reach 5.

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