get_mailboxes
Retrieve mailbox information from a JMAP server to manage email organization and access folders.
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 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) }] }; }
- index.js:67-67 (schema)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) }] }; } );