get_mailbox_status
Retrieve mailbox status including message count and unseen messages to monitor email account activity and manage inbox organization.
Instructions
Get mailbox status (message count, unseen, etc.)
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"mailbox": "<mailbox>"
},
"name": "get_mailbox_status"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mailbox | Yes | Mailbox name |
Implementation Reference
- src/imap_mcp/imap_client.py:157-170 (handler)The core handler implementation for get_mailbox_status, which queries the IMAP client for folder status.
def get_mailbox_status(self, mailbox: str) -> MailboxStatus: """Get mailbox status (message count, unseen, etc.).""" self._ensure_connected() status = self.client.folder_status( mailbox, ["MESSAGES", "RECENT", "UNSEEN", "UIDNEXT", "UIDVALIDITY"] ) return MailboxStatus( name=mailbox, exists=status.get(b"MESSAGES", 0), recent=status.get(b"RECENT", 0), unseen=status.get(b"UNSEEN", 0), uidnext=status.get(b"UIDNEXT", 0), uidvalidity=status.get(b"UIDVALIDITY", 0), ) - src/imap_mcp/server.py:498-499 (registration)The tool registration/dispatch logic for get_mailbox_status within the MCP server.
elif name == "get_mailbox_status": return imap_client.get_mailbox_status(args["mailbox"])