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
| Name | Required | Description | Default |
|---|---|---|---|
| inputSchema | Yes |
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) }] }; }
- index.js:65-68 (schema)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) }] }; } );