Skip to content

feat(cues): add cueapi_bulk_delete_cues tool (cueapi #650 / cli #46 parity)#32

Merged
mikemolinet merged 1 commit into
mainfrom
feat/cues-bulk-delete
May 9, 2026
Merged

feat(cues): add cueapi_bulk_delete_cues tool (cueapi #650 / cli #46 parity)#32
mikemolinet merged 1 commit into
mainfrom
feat/cues-bulk-delete

Conversation

@mikemolinet
Copy link
Copy Markdown
Collaborator

Summary

Adds cueapi_bulk_delete_cues MCP tool. Closes (in part) Backlog row cmousydyn — mistitled "messages" originally; corrected to "cues" by cue-pm 2026-05-09 ~20:45Z after pre-verify caught the title-vs-reality mismatch.

What's added

  • src/tools.ts: new bulkDeleteCuesSchema (Zod) + cueapi_bulk_delete_cues tool.
    • Schema: ids: z.array(z.string()).min(1).max(100).
    • Handler: POSTs to /v1/cues/bulk-delete with body {ids: args.ids} + extraHeaders {"X-Confirm-Destructive": "true"} (server requires it).
  • tests/tools.test.ts: 4 new tests (registered name, empty rejected, overflow rejected, exactly-100 boundary, HTTP contract pin).
  • parity-manifest.json: added POST /v1/cues/bulk-delete mapping to the new tool.

Behavior

// MCP host invokes:
{
  "name": "cueapi_bulk_delete_cues",
  "arguments": { "ids": ["cue_abc", "cue_def", "cue_xyz"] }
}
// → { "deleted": ["cue_abc", "cue_def"], "skipped": ["cue_xyz"] }

Per-ID atomic, NOT batch atomic — IDs that don't exist OR aren't owned by the caller land in skipped (silent skip on miss; no info leak about other tenants' cues). Cascade FK on the server handles executions + dispatch_outbox cleanup.

Stats

  • 3 files changed (+73/-0).

Test plan

  • npm test → 117/117 pass (was 113; 4 new in cueapi_bulk_delete_cues describe block)
  • Schema validation at MCP boundary: empty rejected, > 100 rejected, exactly-100 accepted (boundary pinned)
  • HTTP handler contract pinned: method=POST, path=/v1/cues/bulk-delete, body={ids: [...]}, extraHeaders={"X-Confirm-Destructive": "true"}, query=undefined, apiKey=undefined
  • python3 -c "import json; json.load(open('parity-manifest.json'))" valid

Note re: Backlog row title

Originally cmousydyn was titled "Parity port: bulk delete messages (#650) → cueapi-python + cueapi-mcp + cueapi-action". Pre-verify caught the mismatch — PR #650 is about cues, not messages; cueapi-core has zero @router.delete on messages.py. PM patched the title to 'cues' and confirmed interpretation; this PR ships the cueapi-mcp piece.

Related

Closes

  • Closes (in part) cmousydyn000004lgs0drkbap — this PR ships the cueapi-mcp piece. Row stays in-progress until cueapi-action also ships.

🤖 Generated with Claude Code

…arity)

Adds cueapi_bulk_delete_cues — wraps POST /v1/cues/bulk-delete (cueapi
PR #650; cli ported via PR #46). Closes (in part) Backlog row cmousydyn
(mistitled 'messages' → corrected to 'cues' by cue-pm 2026-05-09 ~20:45Z).

Surface:
- Schema: bulkDeleteCuesSchema accepts ids: array(string).min(1).max(100)
- Tool: cueapi_bulk_delete_cues with handler that POSTs to
  /v1/cues/bulk-delete with body {ids: [...]} + extraHeaders
  {"X-Confirm-Destructive": "true"} (server requires it).
- Returns server's flat shape: {deleted: [...], skipped: [...]}.

Schema validation is enforced at MCP boundary (Zod) before any HTTP
call — empty array rejected, > 100 rejected, exactly-100 accepted.

Tests: 4 new in tools.test.ts — registered name, empty rejection,
overflow rejection, exactly-100 boundary, handler HTTP contract pin
(method/path/body/headers). All 117 tests pass (was 113).

Parity-manifest updated: added POST /v1/cues/bulk-delete row mapping
to the new tool, between existing DELETE /v1/cues/{id} and POST
/v1/cues/{id}/fire entries.

Companion ports:
- cueapi-python PR #37 (merged 2026-05-09 20:49Z) — same row, SDK piece
- cueapi-action PR (forthcoming) — same row, action.yml piece

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@mikemolinet mikemolinet added auto-merge enhancement New feature or request labels May 9, 2026
@mikemolinet mikemolinet merged commit dca0812 into main May 9, 2026
2 checks passed
@mikemolinet mikemolinet deleted the feat/cues-bulk-delete branch May 9, 2026 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-merge enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant