feat(server): add Taskade API v2 tool layer — agent chat + webhooks - #55
Conversation
🦋 Changeset detectedLatest commit: bbd3230 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Additive v2 layer registered alongside v1 — v1's 57 tools are byte-identical (verified zero drift). Adds the capabilities v1 cannot do: agent chat (promptAgent, listConversations, getConversation) and webhooks (subscribe/unsubscribe), generated from the live v2 spec into tools.v2.generated.ts and registered via setupToolsV2 on the /api/v2 base URL with the same bearer token. - codegen: new exportName option (default setupTools) so two tool sets coexist. - gen-taskade-mcp-tools-v2.ts prunes the v2 spec to the enabled ops + their reachable schemas before dereferencing, sidestepping a broken $ref in the v2 Field schema. Smoke-tested: 62 tools register (57 v1 + 5 v2); build + lint + tests green.
7a949a8 to
9f5e20f
Compare
…ets its params Code review of the v2 layer found the flagship `promptAgent` tool registering with an empty input schema. A request body marked `nullable: true` is rewritten by the schema converter to `type: ['object','null']`, which the strict `=== 'object'` guard in the parser skipped — dropping spaceId/agentId/prompt. Accept object types whether scalar or in a nullable union. v1 `tools.generated.ts` is byte-identical (no v1 body is a nullable object), so this is purely additive for v2. Hardening from the same review: - gen-taskade-mcp-tools-v2: throw if an allow-listed action has no matching spec path (was a silent under-generation), and wrap dereference() with a pointed error for the known upstream Field self-$ref. - constants.v2: key HUMANIZED_TASKADE_V2_ACTIONS to the allow-list union so the two cannot drift (compile-time enforced). - parser tests: nullable body, kebab/snake segments, empty-description fallback.
Code-review follow-up: the JSDoc said 'root path' but the fallback (and its test)
also covers param-only paths like /{id}. No behavior change.
Review follow-up — multi-agent review (1 critical found + fixed)Ran One critical issue was found and fixed in-branch; the PR is now clean. Critical — fixed in
|
…ooks (#57) The v2 layer (#55, shipped in 0.1.0) added 5 tools but the README still said 57. Update the count in all 5 places (headline, TOC anchor, Tools header, diagram, positioning line) and add an 'Agent Chat & Webhooks (API v2, beta)' category listing promptAgent / listConversations / getConversation / subscribeWebhook / unsubscribeWebhook. Docs only.
Ports Taskade API v2 into the MCP server as an additive layer next to v1. This is the capability gap that matters: v1 can't do agent chat or webhooks; v2 can.
What you can now do from Claude/Cursor
promptAgent,listConversations,getConversationsubscribeWebhook,unsubscribeWebhookHow (least-effort, zero-regression)
setupToolsV2(this, { url: '…/api/v2', … })after the existing v1setupTools— v1's 57 tools are byte-identical (verified zero drift).exportNameoption (defaultsetupTools) so the two generated tool sets coexist without an export collision.gen-taskade-mcp-tools-v2.tsreads the committedtaskade-public.v2.json, prunes to the enabled ops + their reachable schemas before dereferencing — sidestepping a broken self-$refin the v2Fieldschema that otherwise crashesdereference(). (Upstream spec bug; remove the prune-workaround once fixed.)operationId→path fallback from feat(codegen): derive tool name from path when operationId is absent #53 (v2 ops have no operationId).Verification (local)
Scope / follow-ups
uploadMedia,importBundleZip).Stacked on
mainwhen feat(codegen): derive tool name from path when operationId is absent #53 merges.