Mark Inbox Read
mark_inbox_readMark all unread inbox messages as read. Clear your notification queue with a single action.
Instructions
Mark all unread inbox messages as read.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/inbox.ts:86-108 (handler)The handler function that executes the 'mark_inbox_read' tool logic. It calls Reddit's /api/read_all_messages endpoint and returns a success response or an error.
async () => { try { await client.post("/api/read_all_messages", {}); return { content: [ { type: "text" as const, text: JSON.stringify({ success: true, marked_all_read: true }, null, 2), }, ], }; } catch (error) { return { content: [ { type: "text" as const, text: `Error marking inbox read: ${error instanceof Error ? error.message : String(error)}`, }, ], isError: true, }; } } - src/tools/inbox.ts:82-84 (schema)The input schema for the tool. Accepts an empty object (z.object({})) as no parameters are needed.
title: "Mark Inbox Read", description: "Mark all unread inbox messages as read.", inputSchema: z.object({}), - src/tools/inbox.ts:79-109 (registration)Registration of the 'mark_inbox_read' tool using server.registerTool() with name, schema, and handler.
server.registerTool( "mark_inbox_read", { title: "Mark Inbox Read", description: "Mark all unread inbox messages as read.", inputSchema: z.object({}), }, async () => { try { await client.post("/api/read_all_messages", {}); return { content: [ { type: "text" as const, text: JSON.stringify({ success: true, marked_all_read: true }, null, 2), }, ], }; } catch (error) { return { content: [ { type: "text" as const, text: `Error marking inbox read: ${error instanceof Error ? error.message : String(error)}`, }, ], isError: true, }; } } ); - src/tools/inbox.ts:6-6 (helper)The exported register function that is called from src/index.ts to register all inbox tools (including mark_inbox_read) on the MCP server.
export function register(server: McpServer, client: RedditClient): void { - src/index.ts:32-32 (registration)The line in the main entry point that registers all inbox tools by calling registerInboxTools(server, client).
registerInboxTools(server, client);