feat: add list_customers tool with metadata filtering#7
Open
ignaciomendeznole wants to merge 5 commits intovoucherifyio:mainfrom
Open
feat: add list_customers tool with metadata filtering#7ignaciomendeznole wants to merge 5 commits intovoucherifyio:mainfrom
ignaciomendeznole wants to merge 5 commits intovoucherifyio:mainfrom
Conversation
Adds a new list_customers MCP tool that supports filtering customers by metadata fields and standard fields with pagination. Follows the same pattern as list_products. Enables use cases like finding referees by metadata.referrerUserId or metadata.referralCampaignName. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds two test customers with referrerUserId/referralCampaignName metadata to prepare_project.py and a new scenario_7_list_customers.py that verifies the LLM correctly uses list_customers with metadata filters to find referees. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds a tool to list all redemptions for a given voucher code via
GET /v1/vouchers/{code}/redemptions. Returns customer details for
each redemption, enabling referral investigation (find all referees
who redeemed a referrer's referral code).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Reuse existing club/foo metadata from test data instead of referral-specific fields. Tests now cover single and multiple metadata filter scenarios generically. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds a generic list_vouchers MCP tool that supports filtering by holder_id, campaign_id, is_referral_code, type, active status, and metadata fields. Enables finding all vouchers for a customer (including referral codes not surfaced by qualifications API). Includes test scenario and test data setup for customer 2. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
maurispalletti
approved these changes
Apr 15, 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.
Summary
list_customersMCP tool — search/filter customers by metadata fields and standard fields (name,email,source_id,created_at) with paginationlist_vouchersMCP tool — search/filter vouchers byholder_id,campaign_id,is_referral_code,type,active, and metadata fields with paginationlist_voucher_redemptionsMCP tool — list all redemptions for a voucher code, returning the customer who redeemed it for each entryMotivation
find_customeronly supports lookup by email or ID — no way to search/filter by metadataNew Tools
list_customersPaginated customer search with flexible metadata filtering. Mirrors
list_productsfilter structure.list_vouchersPaginated voucher search with filtering by holder, campaign, type, referral status, and metadata.
list_voucher_redemptionsPaginated redemption history for a voucher code. Each redemption includes the customer who redeemed it.
Implementation
dict_to_querystring()andasync_make_voucherify_request()infrastructurelist_customerscallsGET /v1/customerswith filter query parameterslist_voucherscallsGET /v1/voucherswith filter query parameterslist_voucher_redemptionscallsGET /v1/vouchers/{code}/redemptionsTest Plan
scenario_7_list_customers.py— single metadata filter + multiple metadata filtersscenario_8_list_vouchers.py— filter by holder_id + filter by campaign_idlist_voucher_redemptionsagainst sandbox🤖 Generated with Claude Code