Skip to main content
Glama
cybersmurf
by cybersmurf

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
MAIL_LANGNo`auto` (default: the machine's language, English when unsupported) or a locale codeauto
MAIL_BRANDNoDisplay name of the server, default `Stalwart Mail`Stalwart Mail
STALWART_URLYesPublic address of the Stalwart mail server, e.g. https://mail.example.com (required)
MAIL_TIMEZONENoIANA zone for dates in the output, default the machine's zone
STALWART_USERYesThe mailbox you sign in as (required)
MAIL_OCR_MODELNoModel used by the chosen OCR provider
STALWART_TOKENNoAn OAuth access token instead of the password — sent as Bearer
MAIL_ALLOW_SENDNo`false` removes `send_email` and `send_draft`
MISTRAL_API_KEYNoShortcut: with only this set, scans go to Mistral OCR
MAIL_OCR_API_KEYNoAPI key for the chosen OCR provider
MAIL_TOOL_PREFIXNoPrefix of the tool names, default `mail`mail
MAIL_ALLOW_DRAFTSNo`false` removes `create_draft` and `delete_draft`
MAIL_DOWNLOAD_DIRNoWhere attachments are saved, default `~/Downloads/Mail-Attachments`
MAIL_OCR_BASE_URLNoBase URL of a custom OpenAI-compatible OCR server (used with MAIL_OCR_PROVIDER=custom)
MAIL_OCR_PROVIDERNoWho reads scans: `auto` (default), `mistral`, `anthropic`, `openai`, `openrouter`, `gemini`, `ollama`, `lmstudio`, `custom` or `off`auto
STALWART_PASSWORDNoMailbox or app password — sent as Basic auth
MAIL_SAVE_ATTACHMENTSNo`false` = opened attachments are only read, nothing is written to disk
MAIL_ALLOW_ATTACHMENTSNo`false` removes `get_attachment`
MAIL_ALLOW_CONTACT_EDITNo`false` removes `add_contact`

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
mail_list_mailboxesA

Returns the available accounts (your mailbox plus shared ones), folders with message counts (unread) and the addresses you can send from. Call it first when you do not know which folders or accounts exist. Changes nothing.

mail_search_emailsA

Searches mail (full text, sender, recipient, subject, folder, date, unread, attachments) or lists a whole thread. Returns message ids (for mail_get_email), thread, sender, date and a preview. Newest first, paging through limit/offset. Without a filter it returns the latest messages from all folders (trash included) — for “what is new” use mailbox="inbox", unread=true.

mail_get_emailA

Returns a whole message by id (from mail_search_emails): headers, body text (HTML is converted to text) and the list of attachments. mail_get_attachment reads an attachment's content (PDF, image, text). To reply use mail_send_email with in_reply_to_id. Changes nothing (does not mark the message as read).

mail_get_attachmentA

Downloads an attachment of a received message, saves it to disk and returns its content: text for text files, the text of every page for PDFs, the picture for images. Scans (PDF pages without a text layer) and photos of documents are read through OCR, tables included; pages that came from OCR are marked “(OCR)” — treat numbers from them with some caution and ask for a preview when a figure matters. Other types (docx, xlsx, zip…) only return the path of the saved file. Pick the attachment by name or by its number from the list in mail_get_email; a message with a single attachment needs neither. The message itself is not changed.

mail_send_emailA

Sends an e-mail from the mailbox — a new one, or a reply (in_reply_to_id). A copy is stored in Sent. It sends IMMEDIATELY and cannot be undone. Send only when the user explicitly said the message should go out; otherwise create a draft (mail_create_draft). Verify the recipient before sending — never guess an unknown address, look it up with mail_search_contacts.

mail_create_draftA

Saves a message as a draft in the Drafts folder (does not send). The user can then review it in webmail or on the phone and send it themselves, or mail_send_draft sends it by id. Same parameters as mail_send_email (including replying via in_reply_to_id and attachments).

mail_send_draftA

Sends an existing draft by id (from mail_create_draft or from a search in the drafts folder). Sends immediately — only on the user's explicit instruction.

mail_delete_draftA

Permanently deletes a draft by id. Works only on messages flagged as drafts — it never deletes sent or received mail.

mail_search_contactsA

Finds an e-mail address or phone number: searches the address books (your own and shared ones) and also the mail history (who wrote to you and whom you wrote to, matching the query). Use it whenever you need a person's or company's address before sending anything. Without a query it lists the whole address book.

mail_add_contactA

Creates a contact in an address book. Default is the signed-in mailbox's own address book; pass the account of a shared mailbox to store it in the shared one (everyone with access sees it, on phones too through CardDAV). Check mail_search_contacts first so you do not create a duplicate.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A4.4/5.0

Scored across 10 tools

Disambiguation5/5

Each tool maps to a distinct resource+action: listing mailboxes, searching, fetching a message, fetching an attachment, sending, draft lifecycle (create/send/delete), and contact search/add. Boundaries are clear, with draft-sending vs email-sending distinguished by tool name and description.

Naming Consistency5/5

Every tool follows a strict mail_verb_noun pattern (mail_list_mailboxes, mail_search_emails, mail_get_email, mail_create_draft, etc.). No mixing of conventions or verb styles.

Tool Count5/5

10 tools is well-scoped for a mail server spanning folders, messages, attachments, drafts, and contacts. Each tool clearly earns its place with no redundancy.

Completeness4/5

Core lifecycle is well covered: read/search/attachments, send, full draft lifecycle (create/send/delete), and contact search/add. Gaps remain around managing received mail (move, archive, mark read/unread) and contact update/delete, but agents can work around most of these.

Maintenance

ActivityNo data
ResponsivenessNo issues