GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(gateway): add include=data to event and request listings by leggetter · Pull Request #488 · hookdeck/hookdeck-cli

Conversation

@leggetter

@leggetter leggetter commented Nov 9, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

Summary

Adds include=data to event and request listings, in both the MCP and the CLI. It returns each event's or request's payload (headers, body, path, parsed query) in the list response, so a caller that needs payloads makes one call instead of one per record.

  • MCP: include on the list action of gateway_events_read and gateway_requests_read.
  • CLI: --include data on gateway event list, gateway request list and gateway request events.

Why

The list actions and commands return IDs and metadata only. An agent or script that needs payloads fetches each record by ID, so listing 100 events means 100 more calls, and a fast agent runs into the API rate limit. The API already supports include=data on GET /events, GET /requests and GET /requests/{id}/events. It carries x-docs-hide in the spec, which is why the CLI and MCP left it out.

Changes

  • MCP tools: new include property (enum data) on action list only, forwarded on all three routes. list_ignored refuses it, because GET /requests/{id}/ignored_events does not declare it.
  • CLI commands: new --include flag. It requires --output json, because the list output prints IDs and a summary line and would discard the payloads. Unknown values are left for the API to reject.
  • Default page size: when include is set without a limit, the limit defaults to 10, instead of the API's default page size in the MCP and instead of 100 in the CLI. An explicit limit is honoured.
  • request events paging: this command's JSON is a bare array with no cursor, so a page the API cut short looked complete. When the API reports more events (pagination.next), a note on stderr now gives the cursor to pass to --next, with or without --include. A page that is merely full gets no note. The JSON on stdout is unchanged.
  • Payload fields: EventData now keeps the documented url, method, query, appended_headers and is_large_payload, and RequestData (the spec's ShortEventData) keeps query and is_large_payload, instead of dropping them in decoding. headers and parsed_query accept a string or an object, as the spec allows; before, one record in the string form would fail the whole page.
  • Telling the agent: the MCP tool description, the include property and the gateway_help topic all state the default, that a page of 10 does not mean there are no more (check pagination.next), and to pass limit for a bigger page.
  • Hidden-parameter tests: TestPluralToolsOmitParametersHiddenFromTheAPIDocs and TestListCommandsOmitFlagsHiddenFromTheAPIDocs no longer list include; the other x-docs-hide parameters stay omitted.
  • Docs: README paragraph in the MCP section; REFERENCE.md regenerated.

Testing

  • go test ./... and go vet ./... pass.
  • Unit tests for each MCP tool and each CLI command: forwarding, the default limit (applied, overridden by an explicit limit, absent without include), refusals (list_ignored; CLI without --output json), payload pass-through, the stderr note on request events, and decoding both shapes of headers and parsed_query plus is_large_payload. Reverted each fix in turn and watched only that call site's tests fail.
  • New acceptance tests against the live API, each with a negative control (no data without include; data.body equals the payload sent with it):
    • TestMCPListIncludeData (-tags=mcp)
    • TestEventListIncludeData (-tags=event), which also checks the default limit, the --output json refusal, and that the API rejects an unknown value
    • TestRequestIncludeData (-tags=request), covering request list and request events
    • TestRequestEventsPointsAtTheNextPage (-tags=request): a request fanned out to two events; --limit 1 prints a --next cursor that reaches the second event, and --limit 2 (exactly full) prints no note
  • -tags=mcp and -tags="request event" pass in full.

Not in this PR

  • The API reference does not document include yet.

🤖 Generated with Claude Code

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
leggetter and others added 2 commits November 9, 2026 12:47
@leggetter @claude
feat(gateway): add include=data to event and request listings
3a6d102
Add include to the list action of the gateway_events_read and
gateway_requests_read MCP tools, and --include to gateway event list,
gateway request list and gateway request events. include=data returns
each event's or request's payload (headers, body, path, parsed_query) in
the list response, so a caller that needs payloads makes one call instead
of one per record.

Payloads make responses much larger. When include is set without a
limit, the limit defaults to 10, instead of the API's default page size
in the MCP and instead of 100 in the CLI; an explicit limit is honoured.
The MCP tool description, property and help topic say so. The CLI
refuses --include without --output json, because the list output does
not show payloads.

include carries x-docs-hide in the API spec, so
TestPluralToolsOmitParametersHiddenFromTheAPIDocs and
TestListCommandsOmitFlagsHiddenFromTheAPIDocs listed it as deliberately
omitted. Neither does now; the other hidden parameters stay omitted. The
MCP list_ignored action refuses include, because its route does not
declare it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@leggetter @claude
fix(gateway): keep every include=data payload field, and flag a trunc…
bacf0b0
…ated request events page

EventData and RequestData kept only headers, body, path and parsed_query.
They now also carry the documented url, method, query, appended_headers
and is_large_payload, so a caller can tell a withheld body from an empty
one. headers and parsed_query are typed any, because the spec allows a
string or an object, and one record in the string form failed the whole
list page.

gateway request events prints no pagination cursor, so a page cut at the
--include default of 10 looked complete. When that default fills the page,
the command now says so on stderr, leaving the JSON on stdout intact.

Also adds the missing "without --include nothing changes" case for
request events, and renders --include=data in the Long help.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@leggetter
leggetter marked this pull request as ready for review November 9, 2026 13:13
@leggetter
leggetter requested a balanced review from Copilot November 10, 2026 21:33
Copilot started reviewing on behalf of leggetter November 10, 2026 21:34
View session
Copilot AI reviewed Nov 10, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues block approval of the opt-in payload inclusion change.

No open issues 🎉

What changed in this PR

Adds opt-in payloads to Event Gateway event and request listings in the CLI and MCP, reducing the need to fetch each record individually.

Changes:

  • Exposes include=data on supported list routes, with a default page size of 10 and JSON-only output in the CLI.
  • Expands payload models and supports string or object forms for headers and parsed queries.
  • Adds unit and acceptance coverage, pagination guidance, and updated documentation.
File Description
test/​acceptance/​request_include_data_test.go Tests payload inclusion on request listings and request-scoped events.
test/​acceptance/​mcp_include_data_test.go Tests payload inclusion through MCP against the live API.
test/​acceptance/​event_include_data_test.go Tests event payloads, limits, and invalid options.
REFERENCE.md Documents the new flags, defaults, and examples.
README.md Explains MCP payload inclusion and CLI equivalents.
pkg/​hookdeck/​requests.go Expands request payload fields and decoding support.
pkg/​hookdeck/​list_data_decode_test.go Tests mixed payload shapes and large-payload indicators.
pkg/​hookdeck/​events.go Expands event payload fields and decoding support.
pkg/​gateway/​mcp/​tools.go Adds shared inclusion guidance and default-limit logic.
pkg/​gateway/​mcp/​tool_requests.go Exposes and forwards inclusion for request listings.
pkg/​gateway/​mcp/​tool_requests_events_filters_test.go Tests forwarding and rejection on ignored-event listings.
pkg/​gateway/​mcp/​tool_list_include_data_test.go Tests MCP schemas, defaults, payload output, and guidance.
pkg/​gateway/​mcp/​tool_events.go Exposes and forwards inclusion for event listings.
pkg/​gateway/​mcp/​server_test.go Allows include while keeping other hidden parameters omitted.
pkg/​cmd/​request_list.go Adds payload inclusion to the request list command.
pkg/​cmd/​request_events.go Adds inclusion and a potentially incomplete-page warning.
pkg/​cmd/​request_events_filters_test.go Tests request-event inclusion, limits, and stderr warnings.
pkg/​cmd/​list_include.go Centralises CLI inclusion validation and default limits.
pkg/​cmd/​gateway_list_filters_test.go Tests CLI inclusion forwarding, defaults, and JSON requirements.
pkg/​cmd/​event_list.go Adds payload inclusion to the event list command.

Review effort: Balanced

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@leggetter @claude
fix(request): point at the next page from gateway request events
7b0ce49
gateway request events prints a bare JSON array with no cursor, so a page
the API cut short looked complete. The stderr note added in the previous
commit guessed from the page size and only covered --include. It now
follows the API's pagination.next: when more events exist it prints the
cursor to pass to --next, with or without --include, and a page that is
merely full gets no note. Verified against the live API with a request
that fans out to two events.

Also rewords the is_large_payload comments to what the spec says: the API
flags a payload it considers large and does not index for search.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments

At least 1 approving review is required to merge this pull request.

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@leggetter
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.