Skip to main content
Glama

peek_inbox_version

Check total_unread_count and epoch to poll for new mail without fetching messages; diff the count against your cache and call get_messages only when it changes.

Instructions

Cheap non-mutating mailbox version probe (v2.3.0 Phase 4s, ambient wake support).

When to use: low-rate polling that wants to know 'do I have new mail?' without paying a get_messages round-trip, clients diff total_unread_count against their cached value and only call get_messages on a change. Pair with the optional filesystem-marker wake (when RELAY_FILESYSTEM_MARKERS=1) for low-latency idle wake. For full mailbox content use get_messages (mutating) or get_messages_summary (preview).

Behavior: pure read. Returns { mailbox_id, epoch, last_seq, total_messages_count, total_unread_count }. WATCH total_unread_count for new-mail detection, it advances on every send_message/broadcast to this agent. last_seq is the OBSERVED axis: it advances when the recipient views mail through ANY get_messages call, including peek=true, so it says nothing about delivery or reading, and no decision may key on it. epoch rotates on backup/restore, a client whose cached epoch no longer matches MUST reset its local last_seen_seq to 0 and re-drain. Auth: any agent token.

Returns: { success: true, mailbox_id, epoch, last_seq, total_messages_count, total_unread_count }.

Errors: AUTH_FAILED, NOT_FOUND (unknown agent_name), RATE_LIMITED.

Input Schema

NameRequiredDescriptionDefault
agent_nameYesThe agent whose mailbox to observe
agent_tokenNoYour agent token (from register_agent response). Optional here — also resolvable from RELAY_AGENT_TOKEN env or X-Agent-Token header.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations, the description carries the full behavioral burden and does so thoroughly: declares pure read, lists exactly which fields advance on send/broadcast, warns that last_seq is an OBSERVED axis that must not drive decisions, explains epoch reset requirements after backup/restore, and gives auth and error behavior.

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?

Well front-loaded with labeled sections for when-to-use, behavior, auth, returns, and errors. However the return object is listed twice ('Behavior' and 'Returns') and the version/patch tag 'v2.3.0 Phase 4s' is noise that does not help an agent decide or invoke.

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?

No output schema exists, so the description supplies the return shape, field semantics, error names, auth requirements, and wake behavior. Everything an agent needs to poll correctly and avoid misusing last_seq is present.

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 coverage is 100%, so the schema already documents agent_name and the optional agent_token with env/header fallback. The description's 'Auth: any agent token' and 'NOT_FOUND (unknown agent_name)' add only marginal meaning beyond that.

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 ('cheap non-mutating mailbox version probe') and immediately distinguishes itself from get_messages and get_messages_summary. An agent can tell this is a lightweight polling probe rather than a content fetch without opening the schema.

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 says when to use it ('low-rate polling', 'do I have new mail?'), how to use it (diff total_unread_count), and names the alternatives for full content (get_messages, get_messages_summary). The pairing with filesystem-marker wake is also spelled out.

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