Skip to main content
Glama

get_notifications

Retrieve unread notifications from Habitica to stay updated on tasks, rewards, and account activity.

Instructions

Get unread notifications.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that executes the get_notifications tool logic - makes a GET request to the Habitica API /notifications endpoint and returns the data as JSON.
    get_notifications: async () => json((await api("GET", "/notifications")).data),
  • The tool schema/definition for get_notifications - no input parameters required, returns unread notifications.
    {
      name: "get_notifications",
      description: "Get unread notifications.",
      inputSchema: { type: "object", properties: {} },
    },
  • index.js:482-492 (registration)
    Generic tool registration handler - dispatches tool calls by name to the handlers object. When 'get_notifications' is called, it looks up handlers['get_notifications'].
    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));
      }
    });
  • Helper function that makes HTTP requests to the Habitica API - used by the get_notifications handler to call GET /notifications.
    async function api(method, path, body) {
      const url = `${API_BASE}${path}`;
      const headers = {
        "x-api-user": USER_ID,
        "x-api-key": API_TOKEN,
        "x-client": `${USER_ID}-${APP_ID}`,
        "Content-Type": "application/json",
      };
      const res = await fetch(url, {
        method,
        headers,
        body: body === undefined ? undefined : JSON.stringify(body),
      });
      const text = await res.text();
      let payload;
      try {
        payload = text ? JSON.parse(text) : {};
      } catch {
        payload = { raw: text };
      }
      if (!res.ok) {
        const msg = payload?.message || payload?.error || res.statusText;
        throw new McpError(
          ErrorCode.InternalError,
          `Habitica API ${res.status}: ${msg}`,
        );
      }
      return payload;
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden but only states 'Get unread notifications.' It does not disclose whether calling this tool modifies state (e.g., marks notifications as read), rate limits, or authentication requirements. The behavior is minimally described.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, concise sentence. It is front-loaded with the key action and resource, no unnecessary words. For a simple, parameterless tool, this is appropriately sized.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema or annotations, the description is incomplete. It does not explain what the tool returns (e.g., list of notifications with fields like id, text, timestamp) or any side effects. For a tool with no parameters, more context on the response structure would aid agent invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

There are no parameters, and schema coverage is 100% (empty object). Description adds no parameter information, but none is needed. Baseline 3 is appropriate as schema already covers parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get') and resource ('unread notifications'), making the tool's purpose immediately understandable. It distinguishes from the sibling 'read_notification' which likely marks notifications as read, but does not explicitly guide on when to choose this over other tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No usage guidance is provided. The description does not mention when to use this tool, when not to, or alternatives. For example, it lacks context on whether this tool should be called before 'read_notification' to mark items as read.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/leon-jarvis1/habitca_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server