Skip to main content
Glama

get_flagged_emails

Retrieve flagged emails from Apple Mail accounts to identify important messages requiring attention. Specify account, mailbox, and limit parameters to filter results.

Instructions

Get flagged emails from a mailbox.

Args: account: Account name. Uses JXA_MAIL_DEFAULT_ACCOUNT env var or first account if not specified. mailbox: Mailbox name. Uses JXA_MAIL_DEFAULT_MAILBOX env var or "Inbox" if not specified. limit: Maximum number of emails to return (default: 50)

Returns: List of flagged emails sorted by date (newest first).

Example: >>> get_flagged_emails("Work") [{"subject": "Important task", "flagged": true, ...}, ...]

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
accountNo
mailboxNo
limitNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/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 that it returns a sorted list of emails with a default limit, which is useful behavioral context. However, it doesn't mention potential side effects, error conditions, or authentication requirements, leaving gaps for a tool that interacts with mail systems.

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 well-structured with clear sections (Args, Returns, Example) and front-loaded purpose. It's appropriately sized, though the example could be slightly more concise. Every sentence adds value, with no redundant information.

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 tool's moderate complexity (3 parameters, no annotations, but has output schema), the description is fairly complete. It covers parameters thoroughly and includes an example, though it could benefit from more behavioral context (e.g., error handling). The output schema existence means return values don't need explanation in the description.

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

Parameters5/5

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

The schema description coverage is 0%, so the description must compensate fully. It does this by explaining all three parameters: 'account' (with env var fallback), 'mailbox' (with env var fallback and default), and 'limit' (with default value). This adds crucial meaning beyond the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Get' and resource 'flagged emails from a mailbox', making the purpose explicit. It distinguishes from siblings like 'get_emails' or 'get_unread_emails' by specifying 'flagged' emails, though it doesn't explicitly contrast them in the description text.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like 'search_emails' or 'get_unread_emails'. It mentions default behaviors for parameters but doesn't explain the tool's specific use case context or prerequisites.

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/imdinu/jxa-mail-mcp'

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