Skip to main content
Glama
suhail-ak-2

gmail-mcp-imap

by suhail-ak-2

get_emails_by_label

Retrieve emails from a specific Gmail label or folder, with optional date filters for paging and a mailbox field for subsequent message lookups.

Instructions

Get emails from a specific label or folder (e.g., Github, Naukri jobs, Notes, [Gmail]/Sent Mail, [Gmail]/All Mail). Supports after/before date filters for paging. Results include a mailbox field - pass it as mailbox to get_email_content and other UID-based tools.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
afterNoFilter emails after this date (YYYY/MM/DD or YYYY-MM-DD)
labelYesLabel name (e.g., 'Github', 'Naukri jobs', 'Purchases')
limitNoNumber of emails to fetch
beforeNoFilter emails before this date (YYYY/MM/DD or YYYY-MM-DD) - use this to page further back than the newest results
Behavior3/5

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

With no annotations provided, the description carries the burden of behavioral disclosure. It does reveal useful behaviors: supports date-filter paging and returns a `mailbox` field for chaining to UID-based tools. However, it does not explicitly state that the operation is read-only, does not mention result sorting/ordering, and does not describe error behavior (e.g., unknown label). These are meaningful gaps for a tool with no annotation safety hints.

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 three sentences long and front-loaded with the core purpose. Each sentence earns its place: the first defines the operation, the second explains paging, and the third links results to downstream tools. No filler or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given there is no output schema, the description should explain return values enough for an agent to use them. It highlights the `mailbox` field but does not mention whether results include a UID, message ID, or other fields needed by 'UID-based tools'. It also does not explain how to obtain valid label names (e.g., through `list_labels`). These omissions matter because the agent must correctly chain to `get_email_content` and similar tools.

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?

The input schema already provides 100% coverage of all four parameters, so the description's marginal contribution is limited. It does reinforce that after/before are used for paging and gives label examples, but the schema already documents the date formats and the paging use of `before`. No additional semantics are added for `limit` beyond what the schema states.

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 uses a specific verb+resource construction ('Get emails from a specific label or folder') and provides concrete examples such as 'Github' and '[Gmail]/Sent Mail', making the tool's purpose immediately clear. It distinguishes itself from category-based sibling tools by emphasizing arbitrary labels/folders, and the mention of passing `mailbox` to UID-based tools clarifies its role in the workflow.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives useful context about paging with after/before date filters and how to use the result (`mailbox` field) with `get_email_content`, but it does not explicitly say when to choose this tool over siblings like `get_primary_emails`, `search_emails`, or `list_labels`. There is no 'when not to use' guidance or differentiation from alternative tools for the same objective.

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/suhail-ak-2/gmail-mcp-imap'

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