feat(tools): add cueapi_fire_cue (supersedes #7 with review fixes)#9
Merged
govindkavaturi-art merged 2 commits intomainfrom May 1, 2026
Merged
feat(tools): add cueapi_fire_cue (supersedes #7 with review fixes)#9govindkavaturi-art merged 2 commits intomainfrom
govindkavaturi-art merged 2 commits intomainfrom
Conversation
Adds an MCP tool that wraps the existing POST /v1/cues/{id}/fire
endpoint, with optional payload_override and merge_strategy. The
existing tool surface covers create / list / get / pause / resume /
delete / list_executions / report_outcome — but not "fire an existing
cue right now," which is the primitive an agent needs for ad-hoc
one-shot triggers and for using cues as a lightweight messaging
channel between agents (carrying { message, instruction, task,
reply_cue_id } in payload_override).
Without this tool, MCP-host agents had to fall back to raw HTTP via
shell to invoke this endpoint, which is awkward and unguided.
- src/tools.ts: +27 LoC (Zod schema + tool definition)
- tests/tools.test.ts: +50 LoC (3 HTTP-contract tests mirroring the
existing pause/resume pattern: empty-fire, payload_override + merge,
url-encoded cue_id)
- README.md: add row to "Tools exposed" table + changelog entry
- package.json: bump 0.2.0 → 0.3.0
No backend changes — POST /v1/cues/{id}/fire already exists and is
used by the CLI today. All 48 tests pass (was 45).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Three small fixes from review of #7 before merge: 1. Default merge_strategy bug The MCP tool's schema description claimed "Default 'replace'", but the API's Pydantic default in app/schemas/cue.py is 'merge'. An agent reading the tool description would expect "no merge_strategy passed → replace semantics" when the actual server-side behavior is merge — silently wrong defaults that would surface hours later as "why did my override leave fields from the cue's stored payload". Reordered enum to ["merge", "replace"] (default-first) and fixed the description to match the server's contract. 2. Tool description framing Reframed away from "messaging channel between agents" toward what the tool actually does: fire an existing cue, optionally with per-fire dynamic data. The agent-to-agent messaging pattern via cue payload metadata is the failure-mode the v1 messaging primitive spec (PRs #457/#458 in cueapi/cueapi) is designed to replace; this MCP tool should be honest about being the "fire a cue" primitive, not the "messaging" workaround. 3. Test coverage gap The original 3 tests only exercised merge_strategy='replace' and the empty-body case. Added two: - merge_strategy='merge' explicitly passed (pins the most common real-world case — swap a few fields, keep the rest) - payload_override without merge_strategy (pins the contract that the handler omits the field rather than forcing a client-side default that would override server's Pydantic default) Tests: 50/50 pass (was 48/48; +2 new). Build clean. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Supersedes #7. Same feature (Mike's
cueapi_fire_cueMCP tool wrappingPOST /v1/cues/{id}/fire) plus three review fixes applied as a follow-up commit:merge_strategymismatch — schema described default as'replace', but the API's Pydantic default inapp/schemas/cue.pyis'merge'. Reordered enum + corrected description.merge_strategy='merge'explicitly passed, andpayload_overridewithoutmerge_strategy(pins the contract that the handler omits the field, leaving server's Pydantic default to apply).Diff vs PR #7
src/tools.tssrc/tools.tsREADME.mdtests/tools.test.tsEverything else is identical to #7.
Tests
npm run build— clean.🤖 Generated with Claude Code