Skip to main content
Glama

agent_session_end

End or update an agent session by setting its status to completed, paused, stalled, or abandoned; completed and abandoned runs are timestamped with ended_at.

Instructions

End or update an agent session's status. Use status='completed' when the goal is met, 'paused' to suspend (resume later from the checkpoint), 'stalled' when the vibe-loop stall detector trips, or 'abandoned' to drop the run. Setting completed/abandoned stamps ended_at.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
goalNoOptionally revise the goal
statusYesNew session status
metadataNoMetadata to merge into the session
session_idYesSession id to update

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.1.1

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the full disclosure burden and does add real behavior: completed/abandoned stamp ended_at, paused preserves a resumable checkpoint, stalled ties to the vibe-loop stall detector. It stops short of stating whether ending destroys session data, permission requirements, or what happens to associated tasks.

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?

A single dense sentence that front-loads the core action and then enumerates statuses without filler. Every clause carries usable information; nothing is redundant with annotations or schema.

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?

Given 4 params including a nested metadata object and no output schema, the description covers status semantics and one side effect well. The metadata merge behavior and the return shape rely entirely on the schema, which is acceptable but leaves the nested-object handling underexplained.

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 coverage is 100%, so the baseline is 3, but the description goes further by giving operational meaning to the status enum values that the schema only labels 'New session status'. It also clarifies that goal optionally revises (rather than replaces) the goal, matching the schema's 'Optionally revise the goal'.

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+resource ('End or update an agent session's status') and clarifies the scope is status/goal/metadata rather than the broader lifecycle handled by agent_session_start, agent_resume, or agent_checkpoint. An agent can distinguish it from siblings without opening a 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 maps each status value to an explicit condition: 'completed' when the goal is met, 'paused' to suspend and resume later, 'stalled' when the stall detector trips, 'abandoned' to drop the run. That is high-quality when-to-use guidance, though it never names a sibling alternative or states when not to call this tool.

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