Repository navigation
Conversation
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 <noreply@anthropic.com>
…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 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟢 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=dataon 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
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 <noreply@anthropic.com>
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.
Summary
Adds
include=datato 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.includeon thelistaction ofgateway_events_readandgateway_requests_read.--include dataongateway event list,gateway request listandgateway 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=dataonGET /events,GET /requestsandGET /requests/{id}/events. It carriesx-docs-hidein the spec, which is why the CLI and MCP left it out.Changes
includeproperty (enumdata) on actionlistonly, forwarded on all three routes.list_ignoredrefuses it, becauseGET /requests/{id}/ignored_eventsdoes not declare it.--includeflag. 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.includeis 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 eventspaging: 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.EventDatanow keeps the documentedurl,method,query,appended_headersandis_large_payload, andRequestData(the spec'sShortEventData) keepsqueryandis_large_payload, instead of dropping them in decoding.headersandparsed_queryaccept a string or an object, as the spec allows; before, one record in the string form would fail the whole page.includeproperty and thegateway_helptopic all state the default, that a page of 10 does not mean there are no more (checkpagination.next), and to passlimitfor a bigger page.TestPluralToolsOmitParametersHiddenFromTheAPIDocsandTestListCommandsOmitFlagsHiddenFromTheAPIDocsno longer listinclude; the otherx-docs-hideparameters stay omitted.REFERENCE.mdregenerated.Testing
go test ./...andgo vet ./...pass.include), refusals (list_ignored; CLI without--output json), payload pass-through, the stderr note onrequest events, and decoding both shapes ofheadersandparsed_queryplusis_large_payload. Reverted each fix in turn and watched only that call site's tests fail.datawithoutinclude;data.bodyequals the payload sent with it):TestMCPListIncludeData(-tags=mcp)TestEventListIncludeData(-tags=event), which also checks the default limit, the--output jsonrefusal, and that the API rejects an unknown valueTestRequestIncludeData(-tags=request), coveringrequest listandrequest eventsTestRequestEventsPointsAtTheNextPage(-tags=request): a request fanned out to two events;--limit 1prints a--nextcursor that reaches the second event, and--limit 2(exactly full) prints no note-tags=mcpand-tags="request event"pass in full.Not in this PR
includeyet.🤖 Generated with Claude Code