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: {},
    },
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states what the tool does but doesn't describe how it behaves: no information on permissions needed, rate limits, whether it's cached or real-time, error conditions, or what format the count is returned in. The description is minimal and lacks operational context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that states exactly what the tool does with zero wasted words. It's front-loaded with the core functionality ('Get unread message count') and specifies the scope ('in inbox'). Every word earns its place in this minimal but complete statement.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple read operation with zero parameters and no output schema, the description is minimally complete. It tells the agent what the tool returns (unread count) but doesn't provide context about the return format, units, or possible edge cases. Given the low complexity, it's adequate but leaves the agent to assume details about the response.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, and schema description coverage is 100% (empty schema). The description doesn't need to explain any parameters, which is appropriate. It correctly focuses on the tool's purpose rather than parameter details. A baseline of 4 is given for zero-parameter tools when the description is adequate for the function.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Get') and resource ('unread message count in inbox'), making the purpose immediately understandable. It distinguishes from sibling 'mail_get_total_inbox_count' by specifying 'unread' messages rather than total count. However, it doesn't explicitly mention the data source or system (e.g., email client), which prevents a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. There's no mention of prerequisites, context for usage, or comparison with sibling tools like 'mail_get_total_inbox_count' or 'mail_get_accounts'. The agent must infer usage from the name and description alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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