Skip to content

feat: port cueapi PR #589 + #590 to MCP tools#24

Open
mikemolinet wants to merge 1 commit intomainfrom
feat/parity-port-589-590
Open

feat: port cueapi PR #589 + #590 to MCP tools#24
mikemolinet wants to merge 1 commit intomainfrom
feat/parity-port-589-590

Conversation

@mikemolinet
Copy link
Copy Markdown
Collaborator

Summary

Closes 2 entries from endpoints_missing / tool_param_drift in cueapi-mcp #13's parity-manifest.json. Companion to cueapi-cli #26 (already merged 2026-05-04 17:57-17:59 UTC).

PR #589 — effective payload on GET responses

cueapi_get_execution and cueapi_list_executions are passthrough handlers, so the new payload field surfaces automatically. Tool descriptions updated so MCP hosts know the field exists.

PR #590 — server-side payload_override enforcement

Two new optional fields on cueapi_create_cue + cueapi_update_cue:

Field Type Behavior
require_payload_override bool Reject fires without payload_override (HTTP 400 payload_override_required)
required_payload_keys string[] Required keys in resolved post-merge payload (HTTP 400 missing_required_payload_keys + missing_keys list)

cueapi_fire_cue description surfaces all 3 new server error codes (the third being inconsistent_message_instruction — server enforces byte-equality between message and instruction when both are required, so different recipient handlers route on the same content).

Sparse-update edge cases pinned

Two tests that pin sparse-update semantics on the new fields against a refactor that conflates "unset" and false-y values:

  • passes require_payload_override=false explicitly (clear opt-in) — explicit false must round-trip.
  • passes required_payload_keys=[] explicitly (clear list) — empty array must round-trip (server reads it as "no required keys / clear the list").

Tests

7 new (38 → 45 in tests/tools.test.ts, 86/86 total pass). First PR to add HTTP-contract tests for cueapi_create_cue (didn't exist before).

$ npm test
Test Files  5 passed (5)
     Tests  86 passed (86)

$ npm run build
(clean)

Parity manifest

  • tool_param_drift.cueapi_get_execution.covered_response_fields now includes payload.
  • tool_param_drift."cueapi_create_cue / cueapi_update_cue".covered_request_fields now includes the two new PR #590 fields.
  • ported_pr_history: #589 + #590 marked PORTED.

Test plan

  • npm test → 86/86 pass
  • npm run build → clean
  • Manual smoke against staging cueapi:
    • cueapi_create_cue { name: "test", require_payload_override: true, required_payload_keys: ["task", "token"] }
    • cueapi_fire_cue { cue_id: "<created>" } → expect 400 payload_override_required
    • cueapi_fire_cue { cue_id: "<created>", payload_override: { foo: "bar" } } → expect 400 missing_required_payload_keys with missing_keys=["task","token"]
    • cueapi_get_execution { execution_id: "<from-successful-fire>" } → response includes payload field
    • cueapi_update_cue { cue_id, require_payload_override: false } → opt-out succeeds

Parity Impact

Closes 2 entries from parity-manifest.json — see "Parity manifest" section above. Manifest update included in this PR (no follow-up needed).

Companion PRs

🤖 Generated with Claude Code

Closes 2 entries from `endpoints_missing` / `tool_param_drift` in
cueapi-mcp #13's parity-manifest.json.

## PR #589 — effective payload on GET responses

`cueapi_get_execution` and `cueapi_list_executions` are passthrough
handlers, so the new `payload` field surfaces automatically without
handler changes. Updated descriptions to call out the field so MCP
hosts know it's there (effective payload = payload_override if set
on the fire, else the parent cue's payload at delivery time —
useful for audit, forensics, and "reply via fresh API call" flows
from agents not running inside the bundled-worker handler context).

## PR #590 — server-side payload_override enforcement

Added two new optional fields to `cueapi_create_cue` +
`cueapi_update_cue` schemas and handler passthroughs:

- `require_payload_override` (bool) — when true, fires without
  `payload_override` are rejected with HTTP 400
  `payload_override_required`.
- `required_payload_keys` (string[]) — keys that must be present
  in the resolved post-merge payload. Missing keys yield HTTP 400
  `missing_required_payload_keys` with a `missing_keys` list.

Updated `cueapi_fire_cue` description to surface the 3 new error
codes (the third being `inconsistent_message_instruction`, which
fires when both `message` and `instruction` are required and the
server enforces byte-equality so different recipient handlers
route on the same content).

## Tests

7 new (38 → 45 in `tests/tools.test.ts`, 86 total across all 5
test files):

- cueapi_create_cue: smoke test (didn't exist before — first PR
  to add HTTP-contract tests for the create handler), passes
  PR #590 fields through to body, false/empty edge cases, omits
  fields not explicitly passed (server-default contract)
- cueapi_update_cue: 4 new tests covering the two new field
  passthroughs + their false/empty edge cases (sparse-update
  semantics — explicit false must round-trip, not be conflated
  with unset)

`npm test` — 86/86 pass. `npm run build` — clean.

## Parity manifest

- `tool_param_drift.cueapi_get_execution.covered_response_fields`
  now lists `payload`. Removed from missing.
- `tool_param_drift."cueapi_create_cue / cueapi_update_cue".covered_request_fields`
  now lists the two new PR #590 fields. Removed from missing.
- `ported_pr_history` updated: PR #589 + #590 now PORTED.

## Companion ports

- cueapi-cli #26 (PR #589 + #590 port) — already merged 2026-05-04.
- cueapi-action #2 — pending.
- cueapi-python #23 — pending.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant