You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature request: Add unread message filtering to messages_fetch #154
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:
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.
Activity
Add read status to messages_fetch
Add read status to messages_fetch (mattt#195)