Skip to main content
Glama
jahfer
by jahfer

get_mailboxes

Retrieve mailbox information from a JMAP server to manage email organization and access folders.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputSchemaYes

Implementation Reference

  • index.js:69-79 (handler)
    The handler function that executes the get_mailboxes tool logic: fetches the JMAP session, extracts the mail account ID, retrieves all mailboxes via jam.api.Mailbox.get, and returns a formatted content response with JSON-stringified mailboxes.
    async () => { const session = await jam.session; const accountId = session.primaryAccounts["urn:ietf:params:jmap:mail"]; const [mailboxes] = await jam.api.Mailbox.get({ accountId }); return { content: [{ type: "text", text: JSON.stringify(mailboxes, null, 2) }] }; }
  • The input schema for the get_mailboxes tool, defined as an empty Zod object schema since no input parameters are required.
    inputSchema: z.object({}), // No input parameters needed for this tool
  • index.js:63-80 (registration)
    The server.tool call that registers the get_mailboxes tool, including its name, description, input schema, and handler function.
    server.tool( "get_mailboxes", { description: "Retrieves all mailboxes for the authenticated JMAP account.", inputSchema: z.object({}), // No input parameters needed for this tool }, async () => { const session = await jam.session; const accountId = session.primaryAccounts["urn:ietf:params:jmap:mail"]; const [mailboxes] = await jam.api.Mailbox.get({ accountId }); return { content: [{ type: "text", text: JSON.stringify(mailboxes, null, 2) }] }; } );

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/jahfer/jmap-mcp-server'

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