Skip to main content
Glama

Close Session

exec_close
DestructiveIdempotent

Terminate a running session by ID, freeing resources and joining threads. Idempotent; close every session you start.

Instructions

Kill if running, join threads, free the session. Idempotent: repeat calls return ok, already_closed=true. Close every session you start; sessions persist across requests.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
session_idYesPositive id from exec_start.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYes
errorNo
already_closedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare destructiveHint and idempotentHint, so the bar is lower, yet the description adds real value: it spells out the idempotent repeat-call contract (ok, already_closed=true) and the cross-request persistence trait of sessions. It does not mention permissions or error conditions beyond that.

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?

Three tight sentences, front-loaded with the action and followed by the constraints. Every clause carries information an agent needs; no padding.

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 one-parameter lifecycle tool with an output schema and full annotations, the description covers the key behavioral facts (idempotency contract, session persistence). The only gap is routing relative to exec_kill, which is minor given the output schema handles return details.

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?

With a single parameter and 100% schema description coverage ('Positive id from exec_start'), the schema already carries the semantics. The description adds nothing about session_id, so the baseline 3 applies.

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?

States a concrete multi-step operation ('kill if running, join threads, free the session') on a specific resource, which is far more informative than the title alone. It does not explicitly differentiate itself from the sibling exec_kill, which appears to overlap on the 'kill' behavior.

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?

'Close every session you start' gives a clear standing directive for when to call it, and 'sessions persist across requests' explains why closure matters. It stops short of naming exec_kill or exec_list as alternatives or stating when NOT to close.

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