@churnkey/mcp 0.3.0: warehouse routes, payment recoveries, polish#2
Merged
Conversation
Tools
- Add aggregate_payment_recoveries and list_payment_recoveries, backed
by /v1/data/warehouse/recovery-aggregation and /v1/data/warehouse/
recoveries. Aggregation returns count, invoice/recovered/pending/lost
amounts in original currency and USD with breakdowns by time, card
brand, decline reason, outcome, blueprint, currency, recovered/active.
- Repoint list_sessions and aggregate_sessions to the new warehouse-
backed routes (/v1/data/warehouse/sessions and /v1/data/warehouse/
session-aggregation). The legacy /v1/data/sessions and /v1/data/
session-aggregation routes on the API stay Mongo-backed and unchanged.
Tool descriptions surface the ~3-hour warehouse lag.
- Drop get_api_usage. API request logs aren't synced to the warehouse;
the /v1/data/api-usage REST endpoint itself is unchanged.
Polish from a senior-engineer review pass
- Drop the speculative client-side rate limiter (sequential agent loops
don't need it; the API has its own limits).
- Simplify the HTTP client: drop the unused ChurnkeyApiError class, the
dead {data: ...} response-unwrapping branch, and the redundant 403/
404/422 message handlers (each just returned the catch-all default).
- filters.ts: replace the 19-line manual notShape with z.object(filterShape).
Drop currency/invoiceMonth from BREAKDOWN_VALUES (would silently no-op
against the warehouse). Type buildQuery args properly.
- session-tools description: drop misleading "case-insensitive" claim
on customerEmail; rephrase the `active` describe to read directly.
- Rename tool order, drop unused exports, fix package.json "start"
script which pointed at dist/index.js (the library entry, doesn't
run main()) instead of dist/bin.js.
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
Updates
@churnkey/mcpto point at the new warehouse-backed endpoints, adds payment-recovery analytics tools.Tool surface (post-merge)
list_sessions/v1/data/warehouse/sessionsaggregate_sessions/v1/data/warehouse/session-aggregationlist_payment_recoveries/v1/data/warehouse/recoveriesaggregate_payment_recoveries/v1/data/warehouse/recovery-aggregationdsr_access/v1/data/dsr/accessdsr_delete/v1/data/dsr/deletePolish
client.ts: dropped unusedChurnkeyApiErrorclass, deaddata-unwrap branch, redundant 403/404/422 message branches.filters.ts: replaced the 19-line manualnotShapewithz.object(filterShape). Droppedcurrency/invoiceMonthfromBREAKDOWN_VALUES(would silently no-op against the warehouse). Properly typedbuildQueryargs.package.jsonstartscript that pointed atdist/index.js(library entry, doesn't runmain()).recoveries.tsmatchessessions.tsfor predictability.