API Reference
Todori exposes the following MCP tools for task management. These tools are automatically available in Claude Code when the MCP server is running.
Task Management Tools
create_task
Creates a new task in the current project.
Parameters:
title(string, required): Task titledescription(string, optional): Detailed task descriptionpriority(number, optional): Priority level (0-100), default: 50dependencies(string[], optional): Array of task IDs this task depends onstatus(string, optional): Initial status, default: "pending"
Returns:
{
id: string;
title: string;
status: TaskStatus;
created: ISO8601;
}Example:
{
"title": "Implement user authentication",
"description": "Add JWT-based authentication system",
"priority": 80,
"status": "pending"
}list_tasks
Lists all tasks in the current project.
Parameters:
status(string, optional): Filter by statusminPriority(number, optional): Minimum priority thresholdmaxPriority(number, optional): Maximum priority threshold
Returns:
{
tasks: Task[];
count: number;
}Example:
{
"status": "pending",
"minPriority": 70
}get_task
Retrieves a specific task by ID.
Parameters:
id(string, required): Task ID
Returns:
{
id: string;
title: string;
description?: string;
status: TaskStatus;
priority: number;
dependencies: string[];
subtasks: Subtask[];
metadata: {
created: ISO8601;
updated: ISO8601;
completedAt?: ISO8601;
};
}update_task
Updates an existing task.
Parameters:
id(string, required): Task IDtitle(string, optional): New titledescription(string, optional): New descriptionstatus(TaskStatus, optional): New statuspriority(string, optional): New priority ("high", "medium", "low")dependencies(string[], optional): Replace dependencies listassignee(object | null, optional): Assign task to a session for multi-agent coordinationsessionId(string, required): Session identifier (e.g., branch name)assignedAt(string, optional): ISO8601 timestamp (auto-set if not provided)- Set to
nullto clear the assignee
Returns:
{
id: string;
title: string;
status: TaskStatus;
// ... other task fields
}Example - Basic update:
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"status": "in-progress",
"priority": "high"
}Example - Assign to session (ccmanager):
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"status": "in-progress",
"assignee": {
"sessionId": "feature-auth"
}
}Example - Clear assignee:
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"assignee": null
}delete_task
Deletes a task permanently.
Parameters:
id(string, required): Task ID
Returns:
{
success: boolean;
deletedId: string;
}add_dependency
Adds a dependency relationship between tasks.
Parameters:
taskId(string, required): Task that depends on anotherdependsOn(string, required): Task ID that must be completed first
Returns:
{
success: boolean;
taskId: string;
dependencies: string[];
}Note: Automatically validates against circular dependencies.
remove_dependency
Removes a dependency relationship.
Parameters:
taskId(string, required): Task IDdependencyId(string, required): Dependency to remove
Returns:
{
success: boolean;
taskId: string;
dependencies: string[];
}Subtask Management
add_subtask
Adds a subtask to an existing task.
Parameters:
taskId(string, required): Parent task IDtitle(string, required): Subtask titledescription(string, optional): Subtask description
Returns:
{
taskId: string;
subtaskId: string;
title: string;
}complete_subtask
Marks a subtask as completed.
Parameters:
taskId(string, required): Parent task IDsubtaskId(string, required): Subtask ID
Returns:
{
success: boolean;
taskId: string;
subtaskId: string;
}Task Expansion
expand_task
Expands a task into subtasks using Claude Code's context understanding.
Parameters:
taskId(string, required): Task to expandcontext(string, optional): Additional context for expansion
Returns:
{
taskId: string;
subtasks: Subtask[];
expandedAt: ISO8601;
}Note: This tool generates a prompt for Claude Code to analyze the project and suggest subtasks. The suggestions are then parsed and added as subtasks.
Query Tools
get_next_task
Recommends the next task to work on based on dependencies and priority.
Parameters:
status(string | string[], optional): Filter candidates by status (default: pending, in-progress)priority(string | string[], optional): Filter candidates by prioritycurrentSessionId(string, optional): Current session identifier. When provided, excludes tasks assigned to other sessions (for ccmanager multi-agent coordination)includeMetadata(boolean, optional): Include timestamps in response (default: false)
Returns:
{
task: Task | null;
rationale: string; // Explanation of why this task was recommended
}Example - Basic usage:
get_next_task({})
// Returns highest priority unblocked taskExample - Multi-agent (ccmanager):
get_next_task({
currentSessionId: "feature-auth"
})
// Returns next task not assigned to other sessionsRecommendation Logic:
- Filters to pending/in-progress tasks
- Excludes tasks assigned to other sessions (if
currentSessionIdprovided) - Excludes tasks blocked by incomplete dependencies
- Sorts by priority (high → medium → low)
- Returns the first available task with rationale
query_tasks
Advanced task querying with filters and sorting.
Parameters:
filter(object, optional): Filter criteriastatus(string | string[]): Status filterpriority(object): Priority rangemin(number): Minimum prioritymax(number): Maximum priority
search(string): Search in title and description
sort(object, optional): Sort configurationfield(string): Field to sort by (priority, created, updated)order("asc" | "desc"): Sort order
Returns:
{
tasks: Task[];
count: number;
filters: object;
}Example:
{
"filter": {
"status": ["pending", "in-progress"],
"priority": { "min": 70 },
"search": "authentication"
},
"sort": {
"field": "priority",
"order": "desc"
}
}Data Types
TaskStatus
type TaskStatus =
| "pending"
| "in-progress"
| "blocked"
| "done"
| "deferred"
| "cancelled";Task
interface Task {
id: string; // UUID
title: string;
description?: string;
status: TaskStatus;
priority: Priority; // "high" | "medium" | "low"
dependencies: string[]; // Task IDs
subtasks: Subtask[];
assignee?: TaskAssignee; // For multi-agent coordination
metadata: {
created: ISO8601;
updated: ISO8601;
completedAt?: ISO8601;
};
}TaskAssignee
interface TaskAssignee {
sessionId: string; // Session identifier (e.g., branch name, worktree name)
assignedAt: string; // ISO8601 timestamp
}Used for multi-agent coordination with ccmanager. When a task has an assignee, other sessions can exclude it from get_next_task results by providing their currentSessionId.
Priority
type Priority = "high" | "medium" | "low";Subtask
interface Subtask {
id: string; // UUID
title: string;
description?: string;
completed: boolean;
completedAt?: ISO8601;
}Storage Format
Tasks are stored in .todori/tasks.yaml using YAML format for human readability:
tasks:
- id: 550e8400-e29b-41d4-a716-446655440000
title: Implement user authentication
description: Add JWT-based authentication system
status: in-progress
priority: 80
dependencies: []
subtasks:
- id: 6ba7b810-9dad-11d1-80b4-00c04fd430c8
title: Create user model
completed: true
completedAt: 2025-12-14T10:30:00Z
- id: 6ba7b811-9dad-11d1-80b4-00c04fd430c8
title: Setup JWT middleware
completed: false
metadata:
created: 2025-12-14T09:00:00Z
updated: 2025-12-14T10:30:00ZError Handling
All tools return errors in a consistent format:
{
error: string;
code: string;
details?: object;
}Common Error Codes
TASK_NOT_FOUND: Task ID does not existCIRCULAR_DEPENDENCY: Adding dependency would create a cycleINVALID_STATUS: Invalid status valueINVALID_PRIORITY: Priority out of range (0-100)STORAGE_ERROR: File system errorVALIDATION_ERROR: Input validation failed
Context Window Optimization
Todori is designed to minimize context window usage:
- Average response size: <2KB per tool call
- List operations: Return minimal task summaries by default
- Expansion prompts: Structured to guide Claude Code efficiently
- Storage format: YAML with atomic writes for consistency
Performance Characteristics
- Task creation: O(1)
- Task lookup: O(1) with ID
- Task listing: O(n) where n = number of tasks
- Dependency validation: O(n) for cycle detection
- File I/O: Atomic writes with proper-lockfile for consistency
Integration Examples
See the examples directory for:
- Integration with CI/CD pipelines
- Custom workflow automation
- Project templates
- Advanced query patterns