Skip to main content
Glama

end_session

End a persistent Python session using its session ID to clean up the namespace and free resources.

Instructions

End a persistent Python session and clean up its namespace.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
session_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations, the description carries the behavioral burden. It does disclose that ending the session cleans up its namespace, which signals destructive state removal. However, it does not mention consequences like irreversible variable loss, invalid session_id behavior, or interaction with active sessions.

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?

The description is a single focused sentence with no filler. The core action and resource are front-loaded, making it easy to scan and understand.

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 one-parameter teardown tool, the description is mostly adequate, and an output schema exists to document return values. However, it lacks explicit session_id semantics and usage context, so an agent would need to infer how to obtain and provide the session correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must compensate for the session_id parameter. It does not explicitly explain that session_id identifies the persistent Python session to terminate, though this can be inferred from the tool name and description. No format, source, or lifecycle detail is provided.

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 uses a specific verb ('End') and a clear resource ('persistent Python session'), and adds 'clean up its namespace' to define the scope. It clearly differentiates from sibling tools like begin_session and exec_in_session, so an agent can tell what this tool is for.

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

Usage Guidelines2/5

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

No guidance is given about when to use this tool versus alternatives such as begin_session, exec_in_session, or run_editor_python. The intended context of ending a session created via begin_session is implied but not stated.

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