AffiliateRail docs
MCP

Tool reference

Every tool and resource the MCP server exposes, with inputs, defaults and what comes back.

Every tool takes an optional program_id (prg_…) and defaults to your organization's first program; the program://current resource lists the rest, so "in the Acme program" in a prompt is enough for the assistant to pass the right id. Errors come back as readable messages the assistant can act on, not stack traces.

Read tools

Available to every connection.

top_partners

Rank partners by revenue they brought in over a period, with commissions earned and customers referred.

InputTypeDefault
period7d, 30d, 90d, ytd, all30d
limitinteger 1 to 5010

pending_commissions

Commissions waiting for approval, oldest first, optionally only those at or above an amount.

InputTypeDefault
min_amount_minorinteger, minor units0
limitinteger 1 to 10025

idle_partners

Active partners with no clicks and no sales in the last N days, the longest idle first.

InputTypeDefault
daysinteger 1 to 36530
limitinteger 1 to 10025

revenue_by_period

Affiliate-driven revenue, sales, commissions and new customers bucketed by day, week or month, oldest bucket first.

InputTypeDefault
granularityday, week, monthmonth
periodsinteger 1 to 90, buckets back from now12

partner_detail

Everything about one partner: status, group, balances, lifetime revenue, recent commissions.

InputTypeNotes
handle_or_emailstringThe partner's handle (their ?ref= value) or email address

payout_status

Payouts by status, with every failed or not-eligible payout and its reason.

InputTypeDefault
periodthis_month, last_month, allthis_month

flows_summary

The program's commission flows in priority order: scope, default rate, approval mode, branch count and what each has produced. No inputs beyond program_id.

recent_referrals

The latest referred visits, newest first, with the partner, status (visit, lead, converted) and landing page.

InputTypeDefault
limitinteger 1 to 10020

list_partners

Search partners by name, handle or email, optionally one status, newest first. A blank search lists everyone up to the limit.

InputTypeDefault
querystring, name, handle or email fragmentnone
statuspending, active, declined, suspendedall
limitinteger 1 to 10025

list_customers

Search customers by email, name or identifier, optionally one status, newest first. Each row carries the partner who referred them, or none when the sale arrived direct.

InputTypeDefault
querystring, email, name or identifier fragmentnone
statuslead, trial, active, cancelled, refunded, suspendedall
limitinteger 1 to 10025

list_commissions

Commissions in any status, newest first, with totals for the filter. For the approval queue specifically, pending_commissions is the one that orders oldest first.

InputTypeDefault
statuspending, approved, due, paid, rejected, voidedall
partner_handlestring, only this partner's commissionsall partners
limitinteger 1 to 10025

list_applications

Who is waiting for review and why, oldest first: their answers, where they came from, and any safeguard holds written out in words.

InputTypeDefault
limitinteger 1 to 10025

report

The dashboard's own report engine: clicks, leads, customers, sales, refunds, revenue and commissions, cut six ways over a date range. Rows keyed direct are money that arrived without a partner; the totals include them, which is why they match the dashboard headline. Filtering by partner, group or tag leaves direct money out, because those filters mean "this slice of the partner programme".

InputTypeDefault
dimensionpartner, link, product, group, tag, periodpartner
fromISO date, inclusivetwelve months back
toISO date, inclusivenow
granularityday, week, month, for the period dimensionmonth

list_risk_flags

Fraud signals with their evidence, highest severity first: self-referrals, refund spikes and the rest. History stays readable on every plan; new flags come from the risk checks.

InputTypeDefault
statusopen, reviewing, resolved, dismissedall
limitinteger 1 to 10025

list_resources

The shelf partners see: files and links, in their folders, with audience scoping and published state. No inputs beyond program_id.

messaging_status

Every campaign with its delivery stats and every sequence with its enrolment counts, so you can see at a glance what is sending, paused or done. No inputs beyond program_id.

Write tools

Registered only when the key carries a write scope, and the scope is checked again on every call. Keep these on "needs approval" in your assistant's tool permissions, so you confirm each change before it happens.

approve_commission

Approve one pending commission by id. It becomes due for payout once its holding period has run.

InputTypeNotes
commission_idstringcom_…

reject_commission

Reject one unpaid commission by id, with a reason the partner will see. The money is returned to the program.

InputTypeNotes
commission_idstringcom_…
reasonstring, 1 to 500 charsShown to the partner

invite_partner

Invite someone by email as a pending partner, optionally into a named group. They still go through the review queue.

InputTypeNotes
emailstringRequired
groupstringGroup name or slug; leave out for none
namestringIf known

approve_application

Approve a pending application by id (list_applications has the queue). The partner goes active, their links go live, and they are told by email.

InputTypeNotes
application_idstringapp_…

reject_application

Decline a pending application. The reason is read word for word by the applicant; leave it out and the program's default sentence is used instead.

InputTypeNotes
application_idstringapp_…
reasonstring, up to 1000 charsOptional; shown to the applicant

resolve_risk_flag

Close one open or reviewing flag as resolved (you acted on it) or dismissed (false alarm). The note is required, because it is the audit trail.

InputTypeNotes
risk_flag_idstringrsk_…
statusresolved or dismissedDefault resolved
notestring, 1 to 1000 charsWhat you found

Put a link on the partners' resources shelf. Files are uploaded in the dashboard, so this tool mints links only.

InputTypeNotes
titlestring, 1 to 120 charsRequired
urlstringThe http(s) address the shelf links to
folderstring, up to 60 charsLeave out for the top level
publishbooleanDefault true

update_resource

Rename a resource, move it to a folder, repoint a link, or publish and unpublish it. list_resources has the ids. Only the fields you send change.

InputTypeNotes
resource_idstringres_…
titlestring, 1 to 120 charsOptional
urlstringOptional, links only
folderstring or nullOptional; null moves it to the top level
publishedbooleanOptional

delete_resource

Take one resource off the shelf for good. A file's stored blob goes with it.

InputTypeNotes
resource_idstringres_…

send_campaign

Send a draft or paused campaign now, to the audience already saved on it. This is real email to real partners and cannot be recalled, so the tool is marked destructive: confirm the campaign name and its audience before you approve it.

InputTypeNotes
campaign_idstringcamp_…; messaging_status has the list

pause_sequence

Stop a sequence sending. Nobody is dropped: resuming carries each partner on from the step they were on.

InputTypeNotes
sequence_idstringseq_…

resume_sequence

Turn a paused sequence back on.

InputTypeNotes
sequence_idstringseq_…

Every write returns a confirmation payload (what changed, from what to what, with formatted amounts) and lands in your audit log with the key that made it. See Security.

Resources

program://current

Your default program's settings, plan, partner and commission counts, plus every other program on the organization with its id, currency and portal address. Assistants are instructed to read this first when they need to know which program, currency or plan they are looking at.

catalog://events

The webhook event catalogue: every event the platform emits, grouped by family, with a description and an example payload. The same content as the webhooks guide, shaped for a model.