Skip to main content
Glama

end_session

Idempotent

Signal that this agent session is complete. Flips the underlying AiConversation agentStatus to ENDED so the human-side Settings → Agents UI shows the session as terminated. Optional reason string (1-500 chars) is captured for audit. Idempotent: calling again returns the existing terminal status without changing it. Honest agents call this when they've finished their assigned work or are about to disconnect; humans can also revoke the PAT, which is more forceful but achieves the same lifecycle outcome. Any task leases this session still holds are handed back, so the tasks become available to other agents immediately rather than after the lease expires.

Input Schema

NameRequiredDescriptionDefault
reasonNoOptional short rationale for ending. 1-500 chars.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.8/5.0
Behavior5/5

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

Annotations cover idempotency and non-destructiveness, but the description adds substantial context beyond them: the exact state flip, the audit capture of the reason, and crucially that held task leases are handed back so tasks become available immediately. That lease-release side effect is a meaningful behavioral trait not encoded in any structured field.

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?

Purpose is front-loaded and every sentence carries information (state flip, reason, idempotency, alternative, lease release). It runs five sentences for a one-parameter tool, which is slightly more than strictly necessary, but there is little waste.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema, the description still tells the agent what happens on repeat calls, what happens to held leases, and the alternative mechanism, so nothing needed to call it correctly is missing.

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

Parameters4/5

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

Schema description coverage is 100%, so baseline is 3. The description adds that the optional reason is 'captured for audit', which gives the parameter a purpose beyond its schema definition ('Optional short rationale for ending. 1-500 chars.'). Modest but real added value.

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 and resource ('Signal that this agent session is complete') and then concretizes the effect ('Flips the underlying AiConversation agentStatus to ENDED'). An agent can immediately distinguish this from lifecycle siblings like claim_task or release_task.

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?

Explicitly names when to call it ('when they've finished their assigned work or are about to disconnect') and contrasts an alternative ('humans can also revoke the PAT, which is more forceful but achieves the same lifecycle outcome'). This is true when/when-not/alternative guidance.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.