Feature Request
Add the ability to filter messages_fetch to only return unread incoming messages, and include read status (isRead, dateRead) in the output.
Motivation
Fetching unread messages is one of the most natural queries when using iMCP with an AI assistant:
"Show me my unread messages"
"Do I have any messages I haven't read?"
"What messages need my attention?"
Currently messages_fetch returns all messages matching date/participant/query filters with no way to distinguish read from unread.
Proposed Solution
1. New unread_only parameter on messages_fetch
When true, filter to messages where is_read = 0 AND is_from_me = 0 in chat.db.
2. New isRead and dateRead output fields
Include read status in the message output for all queries, not just filtered ones.
Feasibility
The message table in chat.db already has is_read (INTEGER) and date_read (INTEGER, nanoseconds since reference date) columns. Madrid's Database.swift just needs to SELECT them, and Message.swift needs two new properties.
These columns are well-established across community tooling:
Implementation PRs
I've put together companion PRs for both Madrid and iMCP:
Caveats
is_read = 0 is a best-effort approximation of unread status — it may not exactly match the Messages app badge count in all edge cases. This should be documented in the parameter description.
Feature Request
Add the ability to filter
messages_fetchto only return unread incoming messages, and include read status (isRead,dateRead) in the output.Motivation
Fetching unread messages is one of the most natural queries when using iMCP with an AI assistant:
Currently
messages_fetchreturns all messages matching date/participant/query filters with no way to distinguish read from unread.Proposed Solution
1. New
unread_onlyparameter onmessages_fetchWhen
true, filter to messages whereis_read = 0 AND is_from_me = 0inchat.db.2. New
isReadanddateReadoutput fieldsInclude read status in the message output for all queries, not just filtered ones.
Feasibility
The
messagetable inchat.dbalready hasis_read(INTEGER) anddate_read(INTEGER, nanoseconds since reference date) columns. Madrid'sDatabase.swiftjust needs to SELECT them, andMessage.swiftneeds two new properties.These columns are well-established across community tooling:
is_readfor unread badge countsImplementation PRs
I've put together companion PRs for both Madrid and iMCP:
Caveats
is_read = 0is a best-effort approximation of unread status — it may not exactly match the Messages app badge count in all edge cases. This should be documented in the parameter description.