get_total_count
Count total emails in an IMAP mailbox to monitor message volume or track email activity. Specify a mailbox name or use the default INBOX.
Instructions
Get total email count in mailbox
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mailbox | No | Mailbox name (default: INBOX) |
Implementation Reference
- src/imap_mcp/imap_client.py:766-770 (handler)Actual implementation of get_total_count in the IMAP client class.
def get_total_count(self, mailbox: str = "INBOX") -> int: """Get total email count in mailbox.""" self._ensure_connected() status = self.client.folder_status(mailbox, ["MESSAGES"]) return status.get(b"MESSAGES", 0) - src/imap_mcp/server.py:362-368 (registration)MCP tool definition for get_total_count.
make_tool( "get_total_count", "Get total email count in mailbox", { "mailbox": {"type": "string", "description": "Mailbox name (default: INBOX)"}, }, ), - src/imap_mcp/server.py:643-646 (handler)MCP tool handler dispatching to the client implementation.
elif name == "get_total_count": return imap_client.get_total_count( mailbox=args.get("mailbox", "INBOX"), )