Skip to main content
Glama

get_latest_events

Retrieve recent session events in reverse chronological order to access the most current user messages, tool calls, or assistant responses. Supports filtering by event type and session ID prefix matching.

Instructions

Get the N most recent events in a session, in reverse chronological order (sequence DESC). Use this when you need 'what was the latest X' — e.g., the last user message, the last tool call, the last assistant response. Semantic search is the wrong tool for recency; this one is. Supports session id prefix match.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
session_idYes
limitNoMax events to return (default 10)
event_typeNoOptional: filter to a single event type (user_message, assistant_text, tool_call, etc.)
max_charsNoMax total output characters
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses key behavioral traits: the ordering ('reverse chronological order'), session matching ('session id prefix match'), and output constraints ('max total output characters'). However, it lacks details on permissions, rate limits, error handling, or pagination, which are important for a read operation with multiple parameters.

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 front-loaded with the core purpose, followed by usage guidelines and behavioral details, all in three concise sentences with zero wasted words. Each sentence adds critical information (e.g., ordering, when to use, session matching), making it highly efficient.

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 the complexity (4 parameters, no annotations, no output schema), the description is mostly complete: it covers purpose, usage, ordering, and session matching. However, it lacks details on output format (e.g., structure of returned events) and error cases, which would help an agent use it correctly without an output schema.

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 75% (3 out of 4 parameters have descriptions), so the baseline is 3. The description adds value by explaining the purpose of 'session_id' ('session id prefix match') and implying the use of 'limit' ('N most recent events'), though it doesn't detail 'event_type' or 'max_chars' beyond the schema. This compensates moderately for the schema gaps.

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 clearly states the tool's purpose with specific verbs ('get', 'return') and resources ('N most recent events in a session'), distinguishing it from siblings like 'search' or 'recall' by emphasizing recency over semantic matching. It explicitly contrasts with 'semantic search' and specifies the ordering ('reverse chronological order').

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?

The description provides explicit guidance on when to use this tool ('when you need what was the latest X') and when not to ('semantic search is the wrong tool for recency'), with examples (e.g., 'last user message'). It implicitly contrasts with sibling tools like 'search' by highlighting the recency focus, though it doesn't name specific alternatives.

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/Wynelson94/longhand'

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