Skip to main content
Glama

leave_session

Exit an active collaboration session cleanly as an individual agent when tasks are complete or requested, optionally providing a reason for other participants.

Instructions

Leave a collaboration session gracefully. Clean exit for an agent.

AUTOMATIC TRIGGERS - Call this when:

  • Your assigned tasks are complete

  • You're done with this session and moving to other work

  • User asks you to leave the session

DIFFERENCE from terminate_session: This is for individual agents leaving. Only the orchestrator should call terminate_session to end the entire session.

PARAMETERS:

  • session_id: Session to leave

  • agent_id: Your agent ID

  • reason: Optional reason for leaving (helps other agents understand)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
reasonNo
agent_idYes
session_idYes
Behavior4/5

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

With no annotations, the description carries the behavioral burden. It adds 'gracefully' and 'clean exit' to set expectations, and notes that the reason helps other agents understand, implying the reason is visible to others. However, it leaves implicit what state changes occur, such as whether the session continues or whether other agents are notified.

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 well-structured with a lead sentence, a trigger list, a sibling-differentiation section, and a parameter list. Every section adds needed guidance without redundancies.

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 low-complexity tool with no output schema, it covers the action, when to use it, parameter semantics, and the key sibling distinction. It does not describe return values or failure behavior, but these are not essential for a straightforward leave operation.

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

Parameters5/5

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

The schema provides no parameter descriptions (0% coverage), so the description fully compensates. It explains session_id as the session to leave, agent_id as the caller's ID, and reason as optional with a clear purpose of helping other agents understand.

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 action ('leave a collaboration session') and an explicit design scope ('Clean exit for an agent'). It also differentiates itself from terminate_session, so an agent can tell this apart from the related session-ending sibling tools.

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

Usage Guidelines5/5

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

Lists concrete automatic triggers: tasks complete, moving to other work, or user request. It also explicitly states that this is for individual agents leaving and that only the orchestrator should call terminate_session, removing ambiguity about which session-ending tool to use.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Vedant9500/OpenLMlib'

If you have feedback or need assistance with the MCP directory API, please join our Discord server