create_task
Create new tasks in Habitica including habits, dailies, todos, and rewards with options for difficulty, priority, due dates, and checklists.
Instructions
Create a habit, daily, todo, or reward.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | Yes | ||
| text | Yes | Title. | |
| notes | No | Notes / description. | |
| difficulty | No | 0.1=trivial, 1=easy, 1.5=medium, 2=hard. | |
| priority | No | 0.1=low, 1=med, 1.5=high, 2=urgent. | |
| date | No | Due date for todos (ISO). | |
| value | No | Cost in gold for rewards. | |
| checklist | No |
Implementation Reference
- index.js:92-127 (schema)Schema definition for the create_task tool: accepts type (habit/daily/todo/reward), text (required), and optional notes, difficulty, priority, date, value, and checklist.
{ 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"], }, }, - index.js:380-383 (handler)Handler for create_task: sends a POST request to /tasks/user with the provided args, then returns a success message with the task type, title, and ID.
create_task: async (args) => { const t = (await api("POST", "/tasks/user", args)).data; return ok(`Created ${t.type}: "${t.text}" (id: ${t.id})`); }, - index.js:482-492 (registration)Generic tool call handler that dispatches to handlers[name], which includes create_task when name matches.
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)); } });