Skip to main content
Glama

get_messages

Fetch your agent's incoming messages from the shared relay, ordered by priority, with options to peek without consuming or filter by time window.

Instructions

Drain or peek your own mailbox.

When to use: each turn that should observe new mail; orchestrators that batch-poll many agents may prefer get_messages_summary (cheaper preview) or peek_inbox_version (counts only). For surveys that must NOT consume mail, set peek=true.

Behavior: returns messages addressed to you, ordered by priority then created_at newest-first. By default status='pending' returns un-read messages and atomically marks them read for THIS session (sessions are per-session_id; a fresh terminal re-sees previously-read messages, v2.0 final fix). Optional since ('1h' | '24h' | '7d' | ISO | 'all') trims old mail (v2.1.6 default '24h'). When status='pending' returns 0 with since<24h, the response includes a hint field nudging toward since='all'. peek=true (v2.2.2) suppresses the read-side-effect entirely.

Returns: { messages: MessageRecord[], count, agent, filter, since, since_bound, hint? }. since_bound is the ISO timestamp the relay actually filtered by (after resolving duration shorthands or 'session_start').

Errors: AUTH_FAILED, VALIDATION (bad since format), RATE_LIMITED.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ackNov2.12.0: when true, permanently resolve the returned messages (atomic with the read-mark) so a fresh session won't re-surface them. Only applies to status='pending'. Default false = unchanged behavior.
laneNoFilter by message lane: 'all' (default), 'direct' (point-to-point only), or 'capability' (capability-routed FYI only).all
peekNoWhen true, skip the mark-as-read side effect so repeated status='pending' polls return the same messages. Default false (consume-once).
limitNoMax messages to return
sinceNov2.1.6: time-window filter. Accepts duration ('15m'|'1h'|'24h'|'3d'), ISO8601 timestamp, 'session_start' sentinel, or 'all'/null to disable. Default '24h' trims stale backlog when an agent name is reused.24h
statusNoFilter by status. 'pending' (default) = unresolved + not-read-by-this-session (the action queue). 'read' = read by this session. 'all'/'history' = the full durable record incl. resolved. 'resolved' = only messages you've acked (v2.12.0).pending
agent_nameYesYour agent name
agent_tokenNoYour agent token (from register_agent response). Optional here — also resolvable from RELAY_AGENT_TOKEN env or X-Agent-Token header.
Behavior4/5

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

With no annotations provided, the description carries the full burden. It discloses the read-side-effect (atomically marks messages read per-session), session-scoping behavior, the since-window trimming, the hint field behavior, and error conditions. It does not explicitly state it's a safe read-only operation beyond the peek nuance, but the read-side-effect is thoroughly documented. A slight gap: no mention of rate limits or destructive consequences beyond consume, but this is well-covered.

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?

The description is information-dense but well-structured with clear sections ('When to use', 'Behavior', 'Returns', 'Errors'). It front-loads the core purpose. It's somewhat long but earns each section — every sentence adds operational value (session semantics, version notes, hint behavior, since_bound resolution). Minor deduction for length and some redundancy with schema (e.g., epoch/version annotations repeated).

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?

For an 8-parameter tool with no output schema, this description is remarkably complete. It explains the return object shape with field semantics (since_bound), error enums, session semantics, default behaviors, and interactions between peek/status/since. Complex parameter interactions (ack atomic with read-mark, since_bound resolution, fresh-session re-seeing) are all covered. The description compensates fully for the absent output schema.

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

Parameters3/5

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

Schema description coverage is 100%, and the description adds value by explaining the peek=false default consume semantics and the since_default trimming behavior. However, most parameter meaning (lane, status enums, agent_token resolution) is already fully documented in the schema. The description correctly explains how params interact (peek suppresses read-effect; since windows interplay with status), which pushes it slightly above baseline 3.

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 opens with 'Drain or peek your own mailbox' — a specific, concrete action on a defined resource. It elaborates on behavior (returns messages ordered by priority then created_at newest-first), and distinguishes itself from siblings by naming get_messages_summary and peek_inbox_version as alternatives, clearly establishing its scope.

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 explicitly states when to use it ('each turn that should observe new mail'), when NOT to (surveys that must not consume mail → peek=true), and names specific sibling alternatives (get_messages_summary for cheaper previews, peek_inbox_version for counts only). This is exemplary 'when-to-use' guidance with explicit exclusions.

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/Maxlumiere/bot-relay-mcp'

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