Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
JXA_MAIL_DEFAULT_ACCOUNTNoSet the default Apple Mail account to use for queries (e.g., 'Work' or 'iCloud').
JXA_MAIL_DEFAULT_MAILBOXNoSet the default Apple Mail mailbox to use for queries (e.g., 'Inbox').

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": true
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
list_accounts

List all configured email accounts in Apple Mail.

Returns: List of account dictionaries with 'name' and 'id' fields.

Example: >>> list_accounts() [{"name": "Work", "id": "abc123"}, {"name": "Personal", "id": "def456"}]

list_mailboxes

List all mailboxes for an email account.

Args: account: Account name. Uses JXA_MAIL_DEFAULT_ACCOUNT env var or first account if not specified.

Returns: List of mailbox dictionaries with 'name' and 'unreadCount' fields.

Example: >>> list_mailboxes("Work") [{"name": "INBOX", "unreadCount": 5}, ...]

get_emails

Get emails from a mailbox.

Retrieves emails with standard properties: id, subject, sender, date_received, read status, and flagged status.

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 email dictionaries sorted by date (newest first).

Example: >>> get_emails("Work", "INBOX", limit=10) [{"subject": "Meeting tomorrow", "sender": "boss@work.com", ...}, ...]

get_todays_emails

Get all emails received today 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.

Returns: List of today's emails sorted by date (newest first).

Example: >>> get_todays_emails("Work") [{"subject": "Urgent: Review needed", "sender": "team@work.com", ...}]

get_unread_emails

Get unread 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 unread emails sorted by date (newest first).

Example: >>> get_unread_emails("Work", limit=20) [{"subject": "New message", "read": false, ...}, ...]

get_flagged_emails

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, ...}, ...]

search_emails

Search for emails matching a query string.

Searches in both subject and sender fields (case-insensitive).

Args: query: Search term to look for 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 results (default: 50)

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

Example: >>> search_emails("invoice", "Work") [{"subject": "Invoice #123", "sender": "billing@vendor.com", ...}]

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

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