Habitica

Learn how to use Habitica with Composio

Overview

SLUG: HABITICA

Description

Habitica is an open-source task management application that gamifies productivity by turning tasks into role-playing game elements.

Authentication Details

generic_api_key
stringRequired
generic_id
stringRequired

Connecting to Habitica

Create an auth config

Use the dashboard to create an auth config for the Habitica toolkit. This allows you to connect multiple Habitica accounts to Composio for agents to use.

1

Select App

Navigate to Habitica.

2

Configure Auth Config Settings

Select among the supported auth schemes of and configure them here.

3

Create and Get auth config ID

Click “Create Habitica Auth Config”. After creation, copy the displayed ID starting with ac_. This is your auth config ID. This is not a sensitive ID — you can save it in environment variables or a database. This ID will be used to create connections to the toolkit for a given user.

Connect Your Account

Using API Key

1from composio import Composio
2
3# Replace these with your actual values
4habitica_auth_config_id = "ac_YOUR_HABITICA_CONFIG_ID" # Auth config ID created above
5user_id = "0000-0000-0000" # UUID from database/app
6
7composio = Composio()
8
9def authenticate_toolkit(user_id: str, auth_config_id: str):
10 # Replace this with a method to retrieve an API key from the user.
11 # Or supply your own.
12 user_api_key = input("[!] Enter API key")
13
14 connection_request = composio.connected_accounts.initiate(
15 user_id=user_id,
16 auth_config_id=auth_config_id,
17 config={"auth_scheme": "API_KEY", "val": {"generic_api_key": user_api_key}}
18 )
19
20 # API Key authentication is immediate - no redirect needed
21 print(f"Successfully connected Habitica for user {user_id}")
22 print(f"Connection status: {connection_request.status}")
23
24 return connection_request.id
25
26
27connection_id = authenticate_toolkit(user_id, habitica_auth_config_id)
28
29# You can verify the connection using:
30connected_account = composio.connected_accounts.get(connection_id)
31print(f"Connected account: {connected_account}")

Tools

Executing tools

To prototype you can execute some tools to see the responses and working on the Habitica toolkit’s playground

Python
1from composio import Composio
2from openai import OpenAI
3import json
4
5openai = OpenAI()
6composio = Composio()
7
8# User ID must be a valid UUID format
9user_id = "0000-0000-0000" # Replace with actual user UUID from your database
10
11tools = composio.tools.get(user_id=user_id, toolkits=["HABITICA"])
12
13print("[!] Tools:")
14print(json.dumps(tools))
15
16def invoke_llm(task = "What can you do?"):
17 completion = openai.chat.completions.create(
18 model="gpt-4o",
19 messages=[
20 {
21 "role": "user",
22 "content": task, # Your task here!
23 },
24 ],
25 tools=tools,
26 )
27
28 # Handle Result from tool call
29 result = composio.provider.handle_tool_calls(user_id=user_id, response=completion)
30 print(f"[!] Completion: {completion}")
31 print(f"[!] Tool call result: {result}")
32
33invoke_llm()

Tool List

Tool Name: Add Task to Challenge

Description

Tool to add a new task to a specified challenge. Use when you need to programmatically create a challenge task after the challenge is set up and you have its ID.

Action Parameters

attribute
string
challengeId
stringRequired
date
string
everyX
integer
frequency
string
notes
string
priority
numberDefaults to 1
remindAt
string
tags
array
text
stringRequired
type
stringRequired

Action Response

data
objectRequired
error
string
success
booleanRequired
successful
booleanRequired

Tool Name: Cancel Subscription

Description

Attempts to cancel the authenticated user's subscription. Since Habitica's public API does not provide a cancellation endpoint, this action checks the current subscription state and returns: - success=True with a no-op message if there is no active subscription - success=False with guidance to cancel via the website/app if a subscription appears active

Action Parameters

dry_run
boolean
immediate
boolean
note
string
reason
string

Action Response

data
objectRequired
error
string
message
string
success
booleanRequired
successful
booleanRequired

Tool Name: Create Challenge

Description

Tool to create a new challenge. Use when you need to start a challenge in a specific group with title, summary, and optional tasks.

Action Parameters

description
string
group
stringRequired
leader
string
name
stringRequired
official
boolean
prize
integer
shortName
stringRequired
summary
stringRequired
tasks
array

Action Response

data
objectRequired
error
string
message
string
success
booleanRequired
successful
booleanRequired

Tool Name: Create Habitica Group

Description

Tool to create a Habitica party or guild. Use when you want to initialize a new group with name, type, and optional privacy and description.

Action Parameters

description
string
name
stringRequired
privacy
string
type
stringRequired

Action Response

data
objectRequired
error
string
success
booleanRequired
successful
booleanRequired

Tool Name: Create Tag

Description

Tool to create a new tag. Use after determining the desired tag name.

Action Parameters

name
stringRequired

Action Response

data
objectRequired
error
string
success
booleanRequired
successful
booleanRequired

Tool Name: Create Task

Description

Tool to create a new user task in Habitica. Use after gathering task details like text, type, and optional properties.

Action Parameters

alias
string
attribute
string
checklist
array
collapseChecklist
boolean
date
string
daysOfMonth
array
down
boolean
everyX
integer
frequency
string
notes
string
priority
number
reminders
array
repeat
object
startDate
string
tags
array
text
stringRequired
type
stringRequired
up
boolean
value
number
weeksOfMonth
array

Action Response

data
objectRequired
error
string
success
booleanRequired
successful
booleanRequired

Tool Name: Create Webhook

Description

Tool to create a new webhook for taskActivity events. Use when you need real-time notifications of task creation, updates, deletion, or scoring.

Action Parameters

enabled
booleanDefaults to True
label
string
options
objectRequired
type
stringRequired
url
stringRequired

Action Response

data
objectRequired
error
string
success
booleanRequired
successful
booleanRequired

Tool Name: Delete a Habitica Challenge

Description

Tool to delete a challenge. Use when you need to permanently remove a challenge after confirmation.

Action Parameters

challengeId
stringRequired

Action Response

data
object
error
string
success
booleanRequired
successful
booleanRequired

Tool Name: Delete Challenge Task

Description

Tool to delete a specific task from a challenge. Use when removing an unwanted or outdated task from a challenge. Use after confirming the task belongs to the target challenge.

Action Parameters

task_id
stringRequired

Action Response

data
objectRequired
error
string
message
string
success
booleanRequired
successful
booleanRequired

Tool Name: Delete Habitica Group

Description

Tool to delete a Habitica group (guild) or leave a party. - For parties: Habitica does not support deleting via DELETE /groups/{id}. The correct flow is to leave the party via POST /groups/party/leave. - For guilds: If you are the leader and there are no members, you can delete the guild via DELETE /groups/{id}. Otherwise, you may need to manage membership first.

Action Parameters

groupId
stringRequired

Action Response

data
objectRequired
error
string
message
string
success
booleanRequired
successful
booleanRequired

Tool Name: Delete Habitica Tag

Description

Tool to delete a tag for the authenticated user. Use when you need to remove an obsolete tag after confirming it’s no longer applied to any tasks.

Action Parameters

tagId
stringRequired

Action Response

data
objectRequired
error
string
message
stringRequired
success
booleanRequired
successful
booleanRequired

Tool Name: Delete Task

Description

Tool to delete a Habitica task. Use when you have the task ID and want to remove it permanently.

Action Parameters

taskId
stringRequired

Action Response

data
objectRequired
error
string
success
booleanRequired
successful
booleanRequired

Tool Name: Get Habitica Achievements

Description

Tool to retrieve all available Habitica achievements. Use after authenticating to list achievements and their progress.

Action Parameters

language
string

Action Response

data
objectRequired
error
string
success
booleanRequired
successful
booleanRequired

Tool Name: Get Challenge

Description

Tool to retrieve details of a specific challenge. Use when you have the challenge ID and need its full data.

Action Parameters

challengeId
stringRequired

Action Response

data
objectRequired
error
string
success
booleanRequired
successful
booleanRequired

Tool Name: Get Group Challenges

Description

Tool to retrieve challenges available in a specific group (guild, party, or tavern).

Action Parameters

groupId
stringRequired
limit
integer
page
integer

Action Response

data
arrayRequired
error
string
success
booleanRequired
successful
booleanRequired

Tool Name: Get Challenge Task

Description

Tool to retrieve a specific task from any challenge. Use after you have the task ID and need its full details.

Action Parameters

task_id
stringRequired

Action Response

data
objectRequired
error
string
success
booleanRequired
successful
booleanRequired

Tool Name: Get Challenge Tasks

Description

Tool to get all tasks for a specified challenge. Use when you have a challenge ID and need to list its defined tasks, including challenge metadata per task.

Action Parameters

challengeId
stringRequired

Action Response

data
arrayRequired
error
string
success
booleanRequired
successful
booleanRequired

Tool Name: Get Content

Description

Tool to retrieve global game content definitions. Use when loading Habitica items, equipment, pets, quests, and other definitions. Call once per session to cache content.

Action Parameters

Action Response

data
objectRequired
error
string
success
booleanRequired
successful
booleanRequired

Tool Name: Get Content By Type

Description

Tool to retrieve game content for a specified category. Use when you need to fetch specific Habitica content by its type (e.g., items, quests). Use after identifying the content type.

Action Parameters

language
string
type
stringRequired

Action Response

data
objectRequired
error
string
success
booleanRequired
successful
booleanRequired

Tool Name: Get Equipment

Description

Tool to retrieve the authenticated user’s equipped gear and costume. Use when you need to inspect current battle gear and costume slots.

Action Parameters

Action Response

data
objectRequired
error
string
success
booleanRequired
successful
booleanRequired

Tool Name: Get Group

Description

Tool to retrieve details of a specific group. Use when you have a groupId and need its metadata.

Action Parameters

groupId
stringRequired

Action Response

data
objectRequired
error
string
success
booleanRequired
successful
booleanRequired

Tool Name: Get Group Members

Description

Tool to retrieve members of a specific group. Use when you have a groupId and need its member list.

Action Parameters

groupId
stringRequired

Action Response

data
arrayRequired
error
string
success
booleanRequired
successful
booleanRequired

Tool Name: Get Habitica Groups

Description

Tool to retrieve Habitica groups (guilds, parties, taverns). Use when browsing or searching available groups by type or name before joining.

Action Parameters

limit
integer
name
string
page
integer
type
string

Action Response

data
arrayRequired
error
string
pagination
object
success
booleanRequired
successful
booleanRequired

Tool Name: Get Notifications

Description

Tool to retrieve notifications for the authenticated user. Use when you need to fetch the user's current notification list after authenticating.

Action Parameters

Action Response

data
arrayRequired
error
string
message
string
success
booleanRequired
successful
booleanRequired

Tool Name: Get Party

Description

Tool to retrieve the authenticated user's party details. Use when you need to fetch the current party information after authenticating.

Action Parameters

Action Response

data
objectRequired
error
string
success
booleanRequired
successful
booleanRequired

Tool Name: Get Party Members

Description

Tool to retrieve members of the authenticated user's party. Use after authenticating to list current party members.

Action Parameters

Action Response

data
arrayRequired
error
string
success
booleanRequired
successful
booleanRequired

Tool Name: Get Tags

Description

Tool to retrieve authenticated user's tags. Use when you need to list the authenticated user's tags after confirming credentials.

Action Parameters

Action Response

data
arrayRequired
error
string
success
booleanRequired
successful
booleanRequired

Tool Name: Get Tasks

Description

Tool to retrieve all tasks for the authenticated user. Use when you need the user's current tasks list after authenticating.

Action Parameters

type
array

Action Response

data
arrayRequired
error
string
success
booleanRequired
successful
booleanRequired

Tool Name: Get User Achievements

Description

Tool to retrieve the authenticated user's achievements. Use after authenticating to fetch the current user's achievements.

Action Parameters

Action Response

data
objectRequired
error
string
message
string
success
booleanRequired
successful
booleanRequired

Tool Name: Get User Challenges

Description

Tool to retrieve challenges the authenticated user participates in. Use when you need a paginated list of user challenges.

Action Parameters

member
boolean
owned
string
page
integer

Action Response

data
arrayRequired
error
string
success
booleanRequired
successful
booleanRequired

Tool Name: Get User Inventory

Description

Tool to retrieve the authenticated user's full inventory. Use after authentication to list all owned items.

Action Parameters

Action Response

data
objectRequired
error
string
message
string
success
booleanRequired
successful
booleanRequired

Tool Name: Get User Profile

Description

Tool to retrieve the authenticated user's profile information. Use after authenticating to fetch user details.

Action Parameters

Action Response

data
objectRequired
error
string
message
string
success
booleanRequired
successful
booleanRequired

Tool Name: Get User Quest Progress

Description

Tool to retrieve the authenticated user's quest progress. Use after authenticating to fetch the current user's quest progress.

Action Parameters

group_id
stringDefaults to party
note
string

Action Response

data
objectRequired
error
string
success
booleanRequired
successful
booleanRequired

Tool Name: Get User Stats

Description

Tool to retrieve the authenticated user's Habitica statistics. Use after authentication to fetch user's stats block.

Action Parameters

Action Response

data
objectRequired
error
string
message
string
success
booleanRequired
successful
booleanRequired

Tool Name: Get User Subscription

Description

Tool to retrieve the authenticated user's subscription details. Use after authenticating to verify current subscription status.

Action Parameters

Action Response

data
objectRequired
error
string
success
booleanRequired
successful
booleanRequired

Tool Name: Get Webhooks

Description

Tool to retrieve webhooks for the authenticated user. Use when you need to list the user's webhooks after authenticating.

Action Parameters

Action Response

data
arrayRequired
error
string
success
booleanRequired
successful
booleanRequired

Tool Name: Invite To Group

Description

Tool to invite users to a specific group. Use when you need to send invitations by user UUID, email, or username.

Action Parameters

emails
array
groupId
stringRequired
message
string
usernames
array
uuids
array

Action Response

data
objectRequired
error
string
message
string
success
booleanRequired
successful
booleanRequired

Tool Name: Invite To Party

Description

Tool to invite users to the authenticated user's party. Use when you have a list of identifiers (UUIDs, emails, or usernames) ready and want to add them to your current party.

Action Parameters

emails
array
message
string
usernames
array
uuids
array

Action Response

data
objectRequired
error
string
message
string
success
booleanRequired
successful
booleanRequired

Tool Name: Join Challenge

Description

Tool to join a challenge. Use after confirming the challenge ID to participate in a specific challenge.

Action Parameters

challengeId
stringRequired

Action Response

data
objectRequired
error
string
message
string
success
booleanRequired
successful
booleanRequired

Tool Name: Leave Challenge

Description

Tool to leave a Habitica challenge. Use when you need to remove yourself from a specific challenge and decide whether to keep or remove its tasks.

Action Parameters

challengeId
stringRequired
keep
stringRequired

Action Response

data
objectRequired
error
string
message
string
success
booleanRequired
successful
booleanRequired

Tool Name: Local Login

Description

Tool to authenticate a user via local credentials. Use when needing an API token for subsequent Habitica requests.

Action Parameters

password
stringRequired
username
stringRequired

Action Response

data
objectRequired
error
string
message
string
success
booleanRequired
successful
booleanRequired

Tool Name: Local User Registration

Description

Tool to register a new Habitica user via email and password. Use when creating a fresh account before authentication.

Action Parameters

confirmPassword
stringRequired
email
stringRequired
password
stringRequired
username
stringRequired

Action Response

data
objectRequired
error
string
message
string
success
booleanRequired
successful
booleanRequired

Tool Name: Mark Notifications Seen

Description

Tool to mark specific notifications as read. Use when you want to clear unread notification badges after reviewing your notifications.

Action Parameters

notificationIds
arrayRequired

Action Response

data
arrayRequired
error
string
success
booleanRequired
successful
booleanRequired

Tool Name: Remove Party Member

Description

Tool to remove a member from your party. Use when you need to eject a user from your party as the party leader.

Action Parameters

memberId
stringRequired
message
string

Action Response

data
objectRequired
error
string
message
string
success
booleanRequired
successful
booleanRequired

Tool Name: Score Task

Description

Tool to score (check/uncheck) a Habitica task. Use when you need to mark a task as completed or undone.

Action Parameters

direction
stringRequired
taskId
stringRequired

Action Response

data
objectRequired
error
string
message
string
success
booleanRequired
successful
booleanRequired

Tool Name: Social Auth

Description

Tool to authenticate a user via a social provider. Use after obtaining an OAuth token or code from Facebook, Google, GitHub, or Apple.

Action Parameters

access_token
string
code
string
id_token
string
redirect_uri
string
service
stringRequired

Action Response

data
objectRequired
error
string
message
string
success
booleanRequired
successful
booleanRequired

Tool Name: Subscribe Webhook

Description

Tool to enable (subscribe) an existing webhook by ID for the authenticated user. This aligns with Habitica's documented API by updating the webhook resource to ensure it is enabled. Usage: obtain the webhook ID (e.g., via Get Webhooks or after creating a webhook) and call this action to set enabled=true.

Action Parameters

webhookId
stringRequired

Action Response

data
objectRequired
error
string
success
booleanRequired
successful
booleanRequired