Skip to main content
Glama

Email: List folder messages

email_list_folder_messages
Read-onlyIdempotent

List messages inside one exact folder. Especially for IMAP: list folders -> select folder.id -> list messages -> email.id -> read/action. Dates: after/before are ISO 8601 UTC datetimes (YYYY-MM-DDTHH:MM:SS.sssZ); for "today" use after=start of the user's day. Counting: an empty page is not "zero emails" unless no filter was applied; for totals use folder.total_count/unread_count from email_list_folders instead of listing. IMAP pages are capped at 50 live messages; keep limit small (20) to avoid runtime timeouts. Mailbox folder/label ID: Exact Gmail label, Outlook folder or IMAP folder id. Obtain with: email_list_folders -> folder.id Never pass: human folder name such as Inbox when an ID is required. Email provider ID: Exact email ID returned by Nilyo/Unipile for the connected mailbox. On IMAP (and Exchange over IMAP) the ID encodes folder + UID: it CHANGES when the email is moved or a draft is updated; always reuse the id returned by the last operation. Obtain with: email_list_messages or email_list_folder_messages -> email.id; the id returned by email_move_or_label / email_update_draft after a change Never pass: RFC Message-ID unless a tool explicitly documents it, subject, an email_id captured before a move/update on IMAP.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toNo
fromNo
afterNo
limitNo
beforeNo
cursorNoOpaque pagination cursor returned by previous message listing.
any_emailNo
folder_idYesExact provider folder/label ID from email_list_folders/email_resolve_folder. Human folder names are not IDs. Mailbox folder/label ID: Exact Gmail label, Outlook folder or IMAP folder id. Obtain with: email_list_folders -> folder.id Never pass: human folder name such as Inbox when an ID is required.
account_idNoOptional Nilyo connection ID (unipile_account_id from list_connected_accounts). Omit when the user has one account for this provider. When several exist, Nilyo never guesses: list them (display name, identifier, provider user ID), choose the one the user named or ask, and pass its ID here.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already mark the tool as read-only and idempotent, but the description adds significant behavioral context: IMAP page caps at 50, keep limit at 20 to avoid timeouts, empty pages don't imply zero emails when filters are applied, and IMAP IDs change when messages are moved or drafts updated.

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 front-loaded with the core action and every sentence carries practical value (date formats, counting semantics, ID stability, limits). It is long and could be restructured into clearer sections, but there is no filler.

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?

Covers workflow, date format, pagination hints, ID stability, and common mistakes. With no output schema, it could describe the response shape more fully, but it does reference email.id as the key outcome, so an agent can proceed confidently.

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 only 33%, so the description partially compensates by explaining after/before as ISO 8601 UTC datetimes, the need to keep limit small, and the exactness of folder_id. It does not elaborate on to/from/any_email, but those are conventional filters; the main email-ID caveat is also detailed.

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: 'List messages inside one exact folder.' This clearly distinguishes it from email_list_folders and email_list_messagesa, and the workflow mention of 'folder.id' reinforces the scoped intent.

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?

Gives an explicit workflow ('list folders -> select folder.id -> list messages -> email.id -> read/action') and an explicit when-not-to-use ('for totals use folder.total_count/unread_count from email_list_folders instead of listing'). Also warns against passing human folder names, leaving no ambiguity about when this tool should be called.

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.