list_mailboxes
Retrieve a complete list of all mailboxes from your Fastmail account to view and manage email folders.
Instructions
List all mailboxes in the Fastmail account
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "list_mailboxes"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:999-1010 (handler)The switch-case handler for 'list_mailboxes' tool call. Calls client.getMailboxes() and returns the result as JSON.
switch (name) { case 'list_mailboxes': { const mailboxes = await client.getMailboxes(); return { content: [ { type: 'text', text: JSON.stringify(mailboxes, null, 2), }, ], }; } - src/index.ts:136-144 (registration)Tool registration for 'list_mailboxes' in the ListToolsRequestSchema handler. Defines name, description, and empty inputSchema.
tools: [ { name: 'list_mailboxes', description: 'List all mailboxes in the Fastmail account', inputSchema: { type: 'object', properties: {}, }, }, - src/jmap-client.ts:142-154 (helper)The getMailboxes() method on JmapClient that executes the JMAP Mailbox/get API call and returns the list of mailboxes.
async getMailboxes(): Promise<any[]> { const session = await this.getSession(); const request: JmapRequest = { using: ['urn:ietf:params:jmap:core', 'urn:ietf:params:jmap:mail'], methodCalls: [ ['Mailbox/get', { accountId: session.accountId }, 'mailboxes'] ] }; const response = await this.makeRequest(request); return this.getListResult(response, 0); }