bulk_set_read
Mark multiple emails as read or unread in one call. Specify message IDs, account, and folder to update email states.
Instructions
Mark many emails read/unread in one call. Returns counts of successes and failures. Rate-limited.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| message_ids | Yes | ||
| read | No | ||
| account | No | ||
| folder | No | INBOX |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/productivity_mcp/server.py:809-823 (handler)The tool handler for 'bulk_set_read' — iterates over message_ids, calls provider.set_read() for each, and returns counts of successes/failures with up to 5 error details.
) -> dict[str, Any]: """Mark many emails read/unread in one call. Returns counts of successes and failures. Rate-limited.""" provider = _email(account) ok, failed = 0, 0 errors: list[str] = [] for mid in message_ids: try: provider.set_read(mid, read, folder=folder) ok += 1 except Exception as exc: failed += 1 if len(errors) < 5: errors.append(f"{mid}: {exc}") return {"ok": ok, "failed": failed, "errors": errors} - Function signature defining the tool's input schema: message_ids (list[str]), read (bool, default True), account (str|None), folder (str, default 'INBOX'). The decorator @mcp.tool() exposes this schema to MCP.
def bulk_set_read( message_ids: list[str], read: bool = True, account: str | None = None, folder: str = "INBOX", ) -> dict[str, Any]: - src/productivity_mcp/server.py:802-809 (registration)Tool registration via the @mcp.tool() decorator at line 802. The @_logged wrapper also registers it with the rate limiter.
@mcp.tool() @_logged def bulk_set_read( message_ids: list[str], read: bool = True, account: str | None = None, folder: str = "INBOX", ) -> dict[str, Any]: - Rate limit configuration: 10 calls per 60 seconds for 'bulk_set_read'.
"bulk_set_read": (10, 60.0),