read_notification
Mark a notification as read in Habitica by providing its unique notification ID.
Instructions
Mark a notification as read.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| notificationId | Yes |
Implementation Reference
- index.js:352-358 (schema)Tool definition / input schema for 'read_notification'. Declares the tool name, description, and input schema requiring 'notificationId' (string).
name: "read_notification", description: "Mark a notification as read.", inputSchema: { type: "object", properties: { notificationId: { type: "string" } }, required: ["notificationId"], }, - index.js:463-466 (handler)Handler implementation for 'read_notification'. Sends a POST request to /notifications/{notificationId}/read via the Habitica API and returns a success message.
read_notification: async ({ notificationId }) => { await api("POST", `/notifications/${notificationId}/read`); return ok(`Marked notification ${notificationId} read.`); }, - index.js:482-492 (registration)Generic tool call routing via CallToolRequestSchema. Looks up the handler by name in the 'handlers' object and invokes it with the provided arguments.
server.setRequestHandler(CallToolRequestSchema, async (req) => { const { name, arguments: args = {} } = req.params; const fn = handlers[name]; if (!fn) throw new McpError(ErrorCode.MethodNotFound, `Unknown tool: ${name}`); try { return await fn(args); } catch (err) { if (err instanceof McpError) throw err; throw new McpError(ErrorCode.InternalError, err?.message ?? String(err)); } });