Skip to main content
Glama

mail_get_inbox_count

Retrieve the current number of unread emails in your macOS Mail inbox. Use this tool to monitor email volume without opening the Mail application.

Instructions

Get unread message count in inbox

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function that executes the 'mail_get_inbox_count' tool by running an AppleScript command via osascript to retrieve the unread message count from the Mail application's inbox, parses the stdout output, handles errors, and returns the count in the MCP response format.
    case 'mail_get_inbox_count': try { const command = `osascript -e 'tell application "Mail" to get unread count of inbox'`; const { stdout, stderr } = await execAsync(command); if (stderr.trim()) { return { content: [ { type: 'text', text: `Error getting inbox count: ${stderr.trim()}`, }, ], }; } const unreadCount = parseInt(stdout.trim()); return { content: [ { type: 'text', text: `Unread messages in inbox: ${unreadCount}`, }, ], }; } catch (error: any) { return { content: [ { type: 'text', text: `Error executing inbox count command: ${error.message}`, }, ], }; }
  • src/index.ts:76-83 (registration)
    Tool registration in the ListTools handler, including name, description, and input schema (empty object, no parameters required).
    { name: 'mail_get_inbox_count', description: 'Get unread message count in inbox', inputSchema: { type: 'object', properties: {}, }, },
  • Input schema definition for the tool: an empty object with no properties or requirements.
    inputSchema: { type: 'object', properties: {}, },

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/samicokar/mcp-mac'

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