feat(mcp): add 7 inter-agent task management tools#74
feat(mcp): add 7 inter-agent task management tools#74chitcommit wants to merge 1 commit intomainfrom
Conversation
…tty.cc
Adds a new Task Management domain (domain 11) to the ChittyConnect MCP
server, enabling any Claude session or ChittyAgent to create, list, claim,
complete, and fail inter-agent tasks via the tasks.chitty.cc REST API.
Tools added:
- chitty_task_create — create a task assigned to a specific agent
- chitty_task_list — list/filter tasks by agent, status, task_type
- chitty_task_get — retrieve a task by ID
- chitty_task_claim — claim a pending task (sets X-ChittyOS-Caller header)
- chitty_task_complete — mark a task done with optional result payload
- chitty_task_fail — mark a task failed with error message
- chitty_task_my_tasks — get pending tasks for a named agent (poll queue)
Auth: CHITTY_TASK_TOKEN service token via requireServiceAuth("chittytask").
Read-only hint set for list/get/my_tasks; write hint for create/claim/complete/fail.
chittytask added to CHITTYOS_SERVICES health-check list.
Canonical service: chittycanon://core/services/chittytask
Relationship: chittycanon://rel/connects-to → chittycanon://core/services/chittytask
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
chittyconnect | f6820c0 | Mar 17 2026, 03:14 AM |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
There was a problem hiding this comment.
Pull request overview
Adds 7 inter-agent task management tools (domain 11) to the ChittyConnect MCP server, proxying requests to tasks.chitty.cc. Includes tool schema definitions, dispatch logic with service authentication, and service registry integration.
Changes:
- Added 7
chitty_task_*tool definitions in the tool registry with JSON Schema input validation, and classified 3 as read-only - Added dispatch logic for all 7 tools in
tool-dispatcher.js, usingrequireServiceAuth("chittytask", ...)andcheckAndParseJsonconsistent with existing patterns - Registered
chittytaskinCHITTYOS_SERVICESand documentedCHITTY_TASK_TOKENinwrangler.jsonc
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
wrangler.jsonc |
Documents CHITTY_TASK_TOKEN secret in the secrets comment block |
src/mcp/tool-registry.js |
Adds 7 task management tool schemas and marks 3 as read-only; updates domain count comment |
src/mcp/tool-dispatcher.js |
Adds chittytask to service registry and implements dispatch for all 7 task tools |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const claimHeaders = { ...taskAuth }; | ||
| if (args.agent) claimHeaders["X-ChittyOS-Caller"] = args.agent; | ||
| const url = args.agent | ||
| ? `https://tasks.chitty.cc/api/v1/tasks/${encodeURIComponent(args.task_id)}/claim?agent=${encodeURIComponent(args.agent)}` | ||
| : `https://tasks.chitty.cc/api/v1/tasks/${encodeURIComponent(args.task_id)}/claim`; |
| else if (name.startsWith("chitty_task_")) { | ||
| const { error: taskErr, headers: taskAuth } = await requireServiceAuth( | ||
| "chittytask", | ||
| "ChittyTask", | ||
| ); | ||
| if (taskErr) return taskErr; | ||
| const taskHeaders = { ...taskAuth, "Content-Type": "application/json" }; | ||
|
|
||
| if (name === "chitty_task_create") { | ||
| const body = { | ||
| title: args.title, | ||
| task_type: args.task_type, | ||
| assigned_agent: args.assigned_agent, | ||
| }; | ||
| if (args.description !== undefined) body.description = args.description; | ||
| if (args.priority !== undefined) body.priority = args.priority; | ||
| if (args.payload !== undefined) body.payload = args.payload; | ||
| if (args.depends_on !== undefined) body.depends_on = args.depends_on; | ||
| const response = await fetch("https://tasks.chitty.cc/api/v1/tasks", { | ||
| method: "POST", | ||
| headers: taskHeaders, | ||
| body: JSON.stringify(body), | ||
| }); | ||
| const { data, error: respErr } = await checkAndParseJson( | ||
| response, | ||
| "ChittyTask", | ||
| ); | ||
| if (respErr) return respErr; | ||
| result = data; | ||
| } else if (name === "chitty_task_list") { | ||
| const params = new URLSearchParams(); | ||
| if (args.agent) params.set("agent", args.agent); | ||
| if (args.status) params.set("status", args.status); | ||
| if (args.task_type) params.set("task_type", args.task_type); | ||
| if (args.limit !== undefined) params.set("limit", String(args.limit)); | ||
| if (args.offset !== undefined) params.set("offset", String(args.offset)); | ||
| const url = `https://tasks.chitty.cc/api/v1/tasks${params.toString() ? `?${params}` : ""}`; | ||
| const response = await fetch(url, { headers: taskAuth }); | ||
| const { data, error: respErr } = await checkAndParseJson( | ||
| response, | ||
| "ChittyTask", | ||
| ); | ||
| if (respErr) return respErr; | ||
| result = data; | ||
| } else if (name === "chitty_task_get") { | ||
| if (!args.task_id) { | ||
| return { | ||
| content: [ | ||
| { type: "text", text: "Missing required parameter: task_id" }, | ||
| ], | ||
| isError: true, | ||
| }; | ||
| } | ||
| const response = await fetch( | ||
| `https://tasks.chitty.cc/api/v1/tasks/${encodeURIComponent(args.task_id)}`, | ||
| { headers: taskAuth }, | ||
| ); | ||
| const { data, error: respErr } = await checkAndParseJson( | ||
| response, | ||
| "ChittyTask", | ||
| ); | ||
| if (respErr) return respErr; | ||
| result = data; | ||
| } else if (name === "chitty_task_claim") { | ||
| if (!args.task_id) { | ||
| return { | ||
| content: [ | ||
| { type: "text", text: "Missing required parameter: task_id" }, | ||
| ], | ||
| isError: true, | ||
| }; | ||
| } | ||
| const claimHeaders = { ...taskAuth }; | ||
| if (args.agent) claimHeaders["X-ChittyOS-Caller"] = args.agent; | ||
| const url = args.agent | ||
| ? `https://tasks.chitty.cc/api/v1/tasks/${encodeURIComponent(args.task_id)}/claim?agent=${encodeURIComponent(args.agent)}` | ||
| : `https://tasks.chitty.cc/api/v1/tasks/${encodeURIComponent(args.task_id)}/claim`; | ||
| const response = await fetch(url, { | ||
| method: "POST", | ||
| headers: claimHeaders, | ||
| }); | ||
| const { data, error: respErr } = await checkAndParseJson( | ||
| response, | ||
| "ChittyTask", | ||
| ); | ||
| if (respErr) return respErr; | ||
| result = data; | ||
| } else if (name === "chitty_task_complete") { | ||
| if (!args.task_id) { | ||
| return { | ||
| content: [ | ||
| { type: "text", text: "Missing required parameter: task_id" }, | ||
| ], | ||
| isError: true, | ||
| }; | ||
| } | ||
| const body = {}; | ||
| if (args.result !== undefined) body.result = args.result; | ||
| const response = await fetch( | ||
| `https://tasks.chitty.cc/api/v1/tasks/${encodeURIComponent(args.task_id)}/complete`, | ||
| { | ||
| method: "POST", | ||
| headers: taskHeaders, | ||
| body: JSON.stringify(body), | ||
| }, | ||
| ); | ||
| const { data, error: respErr } = await checkAndParseJson( | ||
| response, | ||
| "ChittyTask", | ||
| ); | ||
| if (respErr) return respErr; | ||
| result = data; | ||
| } else if (name === "chitty_task_fail") { | ||
| if (!args.task_id) { | ||
| return { | ||
| content: [ | ||
| { type: "text", text: "Missing required parameter: task_id" }, | ||
| ], | ||
| isError: true, | ||
| }; | ||
| } | ||
| if (!args.error) { | ||
| return { | ||
| content: [ | ||
| { type: "text", text: "Missing required parameter: error" }, | ||
| ], | ||
| isError: true, | ||
| }; | ||
| } | ||
| const response = await fetch( | ||
| `https://tasks.chitty.cc/api/v1/tasks/${encodeURIComponent(args.task_id)}/fail`, | ||
| { | ||
| method: "POST", | ||
| headers: taskHeaders, | ||
| body: JSON.stringify({ error: args.error }), | ||
| }, | ||
| ); | ||
| const { data, error: respErr } = await checkAndParseJson( | ||
| response, | ||
| "ChittyTask", | ||
| ); | ||
| if (respErr) return respErr; | ||
| result = data; | ||
| } else if (name === "chitty_task_my_tasks") { | ||
| if (!args.agent) { | ||
| return { | ||
| content: [ | ||
| { type: "text", text: "Missing required parameter: agent" }, | ||
| ], | ||
| isError: true, | ||
| }; | ||
| } | ||
| const response = await fetch( | ||
| `https://tasks.chitty.cc/api/v1/tasks/agent/${encodeURIComponent(args.agent)}`, | ||
| { headers: taskAuth }, | ||
| ); | ||
| const { data, error: respErr } = await checkAndParseJson( | ||
| response, | ||
| "ChittyTask", | ||
| ); | ||
| if (respErr) return respErr; | ||
| result = data; | ||
| } else { | ||
| return { | ||
| content: [{ type: "text", text: `Unknown task tool: ${name}` }], | ||
| isError: true, | ||
| }; | ||
| } | ||
| } |
Summary
Adds a Task Management domain (domain 11, 7 tools) to the ChittyConnect MCP server at
connect.chitty.cc/mcp, enabling any Claude session or ChittyAgent to coordinate work viatasks.chitty.cc.chitty_task_create— create a task assigned to a named agent with optional priority, payload, and dependency chainchitty_task_list— list/filter tasks by agent, status, task_type with paginationchitty_task_get— get a specific task by ID (full detail including result)chitty_task_claim— claim a pending task; sendsX-ChittyOS-Callerheader +?agent=query paramchitty_task_complete— mark a task done with optional structured result payloadchitty_task_fail— mark a task failed with an error messagechitty_task_my_tasks— poll pending tasks for a named agent (GET /api/v1/tasks/agent/:name)Implementation Details
Auth: Uses
requireServiceAuth("chittytask", "ChittyTask")which resolvesCHITTY_TASK_TOKENfrom 1Password Connect (services/chittytask/service_token) with fallback to theCHITTY_TASK_TOKENenv var.Read-only hints:
chitty_task_list,chitty_task_get,chitty_task_my_tasks— no side effects.Service registry:
chittytaskadded toCHITTYOS_SERVICESso it appears inchitty_services_statushealth checks.Canonical relationship:
chittycanon://core/services/chittyconnectchittycanon://rel/connects-tochittycanon://core/services/chittytaskSecret to provision
Before deploying, set the service token:
wrangler secret put CHITTY_TASK_TOKEN # Value: Bearer token accepted by tasks.chitty.ccTest plan
npm test— all 227 existing tests passnode --check— syntax validation clean on both modified fileschitty_task_listvia MCP to confirm proxy round-tripCHITTY_TASK_TOKENsecret and verifychitty_task_create+chitty_task_my_tasks🤖 Generated with Claude Code