Skip to main content
Glama
jahfer
by jahfer

get_mailboxes

Retrieve mailbox data using the JMAP MCP Server to manage email organization. This tool provides structured mailbox information for efficient email handling and automation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputSchemaYes

Implementation Reference

  • index.js:69-79 (handler)
    The handler function that executes the get_mailboxes tool: authenticates via JMAP session, retrieves the mail account ID, fetches all mailboxes using JamClient's Mailbox.get API, and returns the JSON-stringified list in the standard MCP content format.
    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) }] }; }
  • Input schema for get_mailboxes tool: an empty Zod object schema indicating no input parameters are required.
    { description: "Retrieves all mailboxes for the authenticated JMAP account.", inputSchema: z.object({}), // No input parameters needed for this tool },
  • index.js:63-80 (registration)
    Registration of the get_mailboxes tool via McpServer.tool(), specifying the tool name, input schema, description, and inline 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) }] }; } );

Other Tools

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

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