Skip to main content
Glama

update_task

Modify any updatable field of a Habitica task: text, notes, difficulty, priority, or date to customize task details.

Instructions

Update fields on a task (text, notes, difficulty, priority, etc).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
taskIdYes
textNo
notesNo
difficultyNo
priorityNo
dateNo

Implementation Reference

  • Handler function for update_task. Calls the Habitica API PUT /tasks/:taskId with the updates and returns a success message.
    update_task: async ({ taskId, ...updates }) => {
      const t = (await api("PUT", `/tasks/${taskId}`, updates)).data;
      return ok(`Updated task: "${t.text}"`);
    },
  • Input schema definition for update_task, with optional fields (text, notes, difficulty, priority, date) and required taskId.
    {
      name: "update_task",
      description: "Update fields on a task (text, notes, difficulty, priority, etc).",
      inputSchema: {
        type: "object",
        properties: {
          taskId: { type: "string" },
          text: { type: "string" },
          notes: { type: "string" },
          difficulty: { type: "number", enum: [0.1, 1, 1.5, 2] },
          priority: { type: "number", enum: [0.1, 1, 1.5, 2] },
          date: { type: "string" },
        },
        required: ["taskId"],
      },
    },
  • index.js:58-367 (registration)
    The 'tools' array containing the update_task tool definition (line 128-143), which is registered with the MCP server via ListToolsRequestSchema handler on line 480.
    const tools = [
      {
        name: "get_user_profile",
        description: "Get the authenticated user's full profile (stats, prefs, items, party, etc).",
        inputSchema: { type: "object", properties: {} },
      },
      {
        name: "get_stats",
        description: "Get user stats only (HP, MP, XP, level, gold, class).",
        inputSchema: { type: "object", properties: {} },
      },
      {
        name: "get_tasks",
        description: "List tasks. Optionally filter by type.",
        inputSchema: {
          type: "object",
          properties: {
            type: {
              type: "string",
              enum: ["habits", "dailys", "todos", "rewards", "completedTodos"],
              description: "Optional task-type filter.",
            },
          },
        },
      },
      {
        name: "get_task",
        description: "Get a single task by id.",
        inputSchema: {
          type: "object",
          properties: { taskId: { type: "string" } },
          required: ["taskId"],
        },
      },
      {
        name: "create_task",
        description: "Create a habit, daily, todo, or reward.",
        inputSchema: {
          type: "object",
          properties: {
            type: { type: "string", enum: ["habit", "daily", "todo", "reward"] },
            text: { type: "string", description: "Title." },
            notes: { type: "string", description: "Notes / description." },
            difficulty: {
              type: "number",
              enum: [0.1, 1, 1.5, 2],
              description: "0.1=trivial, 1=easy, 1.5=medium, 2=hard.",
            },
            priority: {
              type: "number",
              enum: [0.1, 1, 1.5, 2],
              description: "0.1=low, 1=med, 1.5=high, 2=urgent.",
            },
            date: { type: "string", description: "Due date for todos (ISO)." },
            value: { type: "number", description: "Cost in gold for rewards." },
            checklist: {
              type: "array",
              items: {
                type: "object",
                properties: {
                  text: { type: "string" },
                  completed: { type: "boolean", default: false },
                },
                required: ["text"],
              },
            },
          },
          required: ["type", "text"],
        },
      },
      {
        name: "update_task",
        description: "Update fields on a task (text, notes, difficulty, priority, etc).",
        inputSchema: {
          type: "object",
          properties: {
            taskId: { type: "string" },
            text: { type: "string" },
            notes: { type: "string" },
            difficulty: { type: "number", enum: [0.1, 1, 1.5, 2] },
            priority: { type: "number", enum: [0.1, 1, 1.5, 2] },
            date: { type: "string" },
          },
          required: ["taskId"],
        },
      },
      {
        name: "score_task",
        description: "Score a task. direction='up' completes a todo/daily or marks a + habit; 'down' is for negative habits.",
        inputSchema: {
          type: "object",
          properties: {
            taskId: { type: "string" },
            direction: { type: "string", enum: ["up", "down"], default: "up" },
          },
          required: ["taskId"],
        },
      },
      {
        name: "delete_task",
        description: "Delete a task by id.",
        inputSchema: {
          type: "object",
          properties: { taskId: { type: "string" } },
          required: ["taskId"],
        },
      },
    
      // Checklist
      {
        name: "get_task_checklist",
        description: "Get checklist items for a task.",
        inputSchema: {
          type: "object",
          properties: { taskId: { type: "string" } },
          required: ["taskId"],
        },
      },
      {
        name: "add_checklist_item",
        description: "Add a checklist item to a task.",
        inputSchema: {
          type: "object",
          properties: {
            taskId: { type: "string" },
            text: { type: "string" },
          },
          required: ["taskId", "text"],
        },
      },
      {
        name: "update_checklist_item",
        description: "Update text/completed on a checklist item.",
        inputSchema: {
          type: "object",
          properties: {
            taskId: { type: "string" },
            itemId: { type: "string" },
            text: { type: "string" },
            completed: { type: "boolean" },
          },
          required: ["taskId", "itemId"],
        },
      },
      {
        name: "score_checklist_item",
        description: "Toggle a checklist item complete/incomplete.",
        inputSchema: {
          type: "object",
          properties: {
            taskId: { type: "string" },
            itemId: { type: "string" },
          },
          required: ["taskId", "itemId"],
        },
      },
      {
        name: "delete_checklist_item",
        description: "Delete a checklist item.",
        inputSchema: {
          type: "object",
          properties: {
            taskId: { type: "string" },
            itemId: { type: "string" },
          },
          required: ["taskId", "itemId"],
        },
      },
    
      // Tags
      {
        name: "get_tags",
        description: "Get all tags.",
        inputSchema: { type: "object", properties: {} },
      },
      {
        name: "create_tag",
        description: "Create a tag.",
        inputSchema: {
          type: "object",
          properties: { name: { type: "string" } },
          required: ["name"],
        },
      },
    
      // Inventory / pets / mounts / equip
      {
        name: "get_inventory",
        description: "Get full inventory (items, eggs, food, hatching potions, special).",
        inputSchema: { type: "object", properties: {} },
      },
      {
        name: "get_pets",
        description: "Get owned pets map.",
        inputSchema: { type: "object", properties: {} },
      },
      {
        name: "get_mounts",
        description: "Get owned mounts map.",
        inputSchema: { type: "object", properties: {} },
      },
      {
        name: "feed_pet",
        description: "Feed a pet a piece of food.",
        inputSchema: {
          type: "object",
          properties: {
            pet: { type: "string", description: "Pet key, e.g. Wolf-Base." },
            food: { type: "string", description: "Food key, e.g. Meat." },
          },
          required: ["pet", "food"],
        },
      },
      {
        name: "hatch_pet",
        description: "Hatch a pet from an egg + hatching potion.",
        inputSchema: {
          type: "object",
          properties: {
            egg: { type: "string" },
            hatchingPotion: { type: "string" },
          },
          required: ["egg", "hatchingPotion"],
        },
      },
      {
        name: "equip_item",
        description: "Equip a pet, mount, costume piece, or battle gear.",
        inputSchema: {
          type: "object",
          properties: {
            type: { type: "string", enum: ["pet", "mount", "costume", "equipped"] },
            key: { type: "string" },
          },
          required: ["type", "key"],
        },
      },
    
      // Rewards / shop / spells
      {
        name: "buy_reward",
        description: "Buy a custom reward by key.",
        inputSchema: {
          type: "object",
          properties: { key: { type: "string" } },
          required: ["key"],
        },
      },
      {
        name: "get_shop",
        description: "Get items in a shop (default: market).",
        inputSchema: {
          type: "object",
          properties: {
            shopType: {
              type: "string",
              enum: ["market", "questShop", "timeTravelersShop", "seasonalShop"],
              default: "market",
            },
          },
        },
      },
      {
        name: "buy_item",
        description: "Buy an item from a shop.",
        inputSchema: {
          type: "object",
          properties: {
            itemKey: { type: "string" },
            quantity: { type: "number", default: 1 },
          },
          required: ["itemKey"],
        },
      },
      {
        name: "cast_spell",
        description: "Cast a class spell, optionally on a target task or party member.",
        inputSchema: {
          type: "object",
          properties: {
            spellId: { type: "string" },
            targetId: { type: "string" },
          },
          required: ["spellId"],
        },
      },
    
      // Notifications
      {
        name: "get_notifications",
        description: "Get unread notifications.",
        inputSchema: { type: "object", properties: {} },
      },
      {
        name: "read_notification",
        description: "Mark a notification as read.",
        inputSchema: {
          type: "object",
          properties: { notificationId: { type: "string" } },
          required: ["notificationId"],
        },
      },
    
      // Cron
      {
        name: "run_cron",
        description: "Run the daily cron (advance day, apply damage from missed dailies). Normally auto-runs on first action of the day.",
        inputSchema: { type: "object", properties: {} },
      },
    ];
  • Helper functions ok() and json() used by update_task to format text/text responses.
    const ok = (text) => ({ content: [{ type: "text", text }] });
    const json = (obj) => ok(JSON.stringify(obj, null, 2));
  • The api() helper function used by update_task to make the HTTP PUT request to the Habitica API.
    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;
    }
Behavior1/5

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

No annotations are provided. The description only says 'Update fields on a task,' implying mutation but not disclosing side effects, return behavior, permissions, or destructive potential.

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?

Single sentence, no fluff. However, it may be too concise given the lack of additional context elsewhere.

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

Completeness1/5

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

No output schema, no annotations, and 6 parameters with 0% schema coverage. The description fails to explain return values, behavior on partial updates, or any other necessary context.

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

Parameters2/5

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

Schema description coverage is 0%. The description lists some fields (text, notes, difficulty, priority) but omits taskId and date, and does not explain the meaning or constraints of any parameter.

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

Purpose5/5

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

The description clearly states it updates fields on a task, listing examples (text, notes, difficulty, priority, etc.). This distinguishes it from sibling tools like delete_task or score_task.

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 guidance on when to use this tool vs alternatives. Does not specify when not to use it or mention any prerequisites or alternatives.

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