Skip to main content
Glama
SpasticPalate

Proton MCP Server

proton_list_folders

Retrieve all mailbox folders with message and unread counts to organize and manage Proton Mail email storage.

Instructions

List all mailbox folders (INBOX, Sent, Drafts, Trash, etc.) with message counts and unread counts

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
response_formatNotext

Implementation Reference

  • The registration and handler logic for the 'proton_list_folders' tool.
    server.registerTool(
      'proton_list_folders',
      {
        title: 'List Proton Mail Folders',
        description: 'List all mailbox folders (INBOX, Sent, Drafts, Trash, etc.) with message counts and unread counts',
        inputSchema: ListFoldersSchema,
        annotations: {
          readOnlyHint: true,
          destructiveHint: false,
          idempotentHint: true,
          openWorldHint: false,
        },
      },
      async (params: z.infer<typeof ListFoldersSchema>) => {
        try {
          const folders = await listMailboxes();
    
          if (params.response_format === 'json') {
            return {
              content: [
                {
                  type: 'text',
                  text: JSON.stringify(folders, null, 2),
                },
              ],
            };
          }
    
          // Format as markdown table
          let result = '| Folder | Messages | Unread |\n';
          result += '|--------|----------|--------|\n';
    
          for (const folder of folders) {
            const name = folder.name || folder.path;
            result += `| ${name} | ${folder.messageCount} | ${folder.unreadCount} |\n`;
          }
    
          return {
            content: [
              {
                type: 'text',
                text: result,
              },
            ],
          };
        } catch (error) {
          return {
            content: [
              {
                type: 'text',
                text: `Error listing folders: ${error instanceof Error ? error.message : String(error)}`,
              },
            ],
          };
        }
      }
    );
  • Schema definition for the inputs accepted by the 'proton_list_folders' tool.
    export const ListFoldersSchema = z.object({
      response_format: z.enum(['text', 'json']).optional().default('text'),
    });

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/SpasticPalate/proton-mcp-server'

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