Skip to help content
RightMessage
MCP referenceReference

MCP tools for split tests

Create, inspect, update, start, end, and delete split tests, and read the results of any A/B test, including variant payloads and the publication boundary.

Available on the Grow, Scale, and Pro plans.

Updated

View as Markdown

Split-test tools manage test records for existing questions, offers, and flows. They do not create duplicate base resources. Starting a test changes its stored status immediately, and the test reads Starts on Publish until publication puts it on the website. Ending a test keeps one version, can replace original content in the draft, and reads Ends on Publish until you publish.

list-ab-tests and get-ab-test read the results of every kind of A/B test, as the dashboard's A/B testing page shows them: campaign personalization tests, page and audience tests, and question, offer, form, and flow tests.

A/B tests of a campaign audience or the original page use different tools: start-audience-test, restart-audience-test, end-audience-test, and undeploy-original-winner. See MCP tools for campaigns.

MCP split-test access and lifecycle

Every operation accepts an optional string project_id and follows the shared MCP authorization and project-selection rules. Invalid or inaccessible projects return errors.

split_test_pid is the public test ID returned as pid, not a resource ID or a made-up st_ identifier. Missing input, invalid IDs, and cross-project or unknown tests return errors.

The stored status sequence is draft → active → completed. Only draft tests can be edited or started. Only active tests can be ended. Completed tests cannot be restarted. Deleting an active test is prohibited. The A/B testing state described in A/B test results is separate from status.

Examples are illustrative and were not executed. Requests are tools/call parameters; responses are decoded payloads. Synthetic resource IDs assume that the corresponding resources already exist in WorkForge.

Variant payloads

variants is an array of variant objects. Control is implicit and should not be included. Common fields are:

FieldTypeMeaning
idstringNonempty variant identifier, distinct from control.
namestringNonempty display name.
weightnumberCreation requires 0–100; non-control weights must total at least 1 and less than 100.

A variant's weight is its percent of visitors, and the remaining weight is reserved for control. The split is fixed once the test starts. A supplied control object is removed during creation, and the remaining weights are redistributed. For an even split, use 50 for one variant, 33 each for two, 25 each for three, or 20 each for four.

Question overrides

Question tests support one to three non-control variants, with unique IDs. Only one draft or active test may exist for a question, offer, or flow.

  • text: optional nullable string overriding question text. Blank wording inherits control.
  • description: optional nullable string with the same inheritance behavior.
  • answers: optional nullable object keyed by an existing answer's segment ID (seg_…, the option's segmentId), never the answer option ID (rqo_…). A value can be a label string or an object with label and imageUrl. Omitted, null, or empty-string values inherit control; promotion applies only nonempty label/image strings. Unknown segment keys do not create options.

Choice questions can vary question and answer wording. Input questions use text and description overrides. These payloads do not create new answer segments or change the underlying input type. buttonText is not a promoted question override.

Offer overrides

Offer variants can contain parts, an object with title, description, buttonText, and imageUrl string overrides. Omit a part to inherit it. Use intentional, nonempty values rather than null or empty patches.

A link-action offer can also contain link, a sparse object with only:

  • url: optional nonempty destination string.
  • open: optional boolean controlling whether it opens in a new tab.

Omitting link inherits the complete link. Within a supplied link, omitted fields inherit. Unknown link keys, null/empty link objects, malformed values, or link overrides on non-link offers are rejected. Offer tests support one to three variants.

Flow overrides

Flow tests support one to four variants. Every variant must include a complete funnelDefinition object with type: "root". It is a replacement tree, not a patch.

The tool advertises this as an open object rather than a separate recursively enumerated JSON schema. Preserve the complete valid flow node structure, including each node's type-specific fields and ordered child or branch arrays. The creation handler checks that the supplied root is a nonempty object/array with root type; that is not a guarantee that every nested node is runnable. Read the existing flow and use its validated node definitions rather than inferring a tree from these minimal root checks.

A/B test results

get-split-test-metrics, list-ab-tests, get-ab-test, the result of get-split-test, and the campaign test results of get-campaign-performance all return each test in the same shape. It's the test's row on the A/B testing page. Results cover the test's whole run, not a date range, and refresh every hour. Nothing in these tools computes a statistic of its own, so they always match the dashboard.

FieldMeaning
id, reportUrlThe test's ID and a link to its report. The ID is the campaign ID (cpn_…) for a personalization test, an abt_… ID for a page or audience test, or the split test pid.
kind, kindLabelpersonalization, page, audience, question, offer, or flow, and its label, such as Page test. An offer with form fields reads Form test.
nameThe tested item, the audience, or Original page.
state, stateLabelThe test's state, listed below, and its label as the dashboard shows it.
needsDecisiontrue at winner_found and control_wins, when you can end the test and keep a version, and at paused_health, when you restart it. Always false for personalization tests, which have nothing to end.
verdictThe report's own sentence, such as "Variant A is ahead with a 66% chance to beat Control. It needs 95% to win."
campaign, resource, goalThe campaign ({id, name}) for campaign tests, the tested item ({type, id, name, usedInFlows}) for the others, and the campaign test's goal ({id, name}). Each is null where it doesn't apply.
metric, metricLabelconversion_rate, answer_rate, completion_rate, or offer_conversion_rate, and its label.
startedAt, endedAt, winnerSince, computedAtWhen the run started and ended, when the current winner reached a 95% chance, and when the results were computed. Null when they don't apply.
splitThe planned split as text, such as 50 / 50.
versionsControl first, then each variant. Fields are below.
leaderThe arm of the variant ahead so far, which isn't a verdict. Null while no variant has a chance.
visitorsNeeded{visitors, needed, neededText}: visitors so far and about how many in total the leader needs to reach 95%, or, when every variant trails Control, until every variant falls to 5%, at the current rates. needed is null once the verdict is in or when it can't be estimated. Null before the run starts.
estimateFor a draft, {weeks, text}, such as "About 4 weeks to a verdict". It assumes one version is about 20% better and uses the last 28 days of traffic. Null for other states and without recent traffic.
healthstatus (ok, paused, or not_checked), reason (allocation, contamination, unconfirmed_publish, or null), the planned and observed share of visitors per arm, and contaminationRate, the share who saw more than one version.
notLiveFor paused_not_live, why visitors can't see the test: reason is widget_off, flow_not_shown, or not_in_flow, and name names the widget or flow. Null otherwise.
outcomeFor an ended test, keptVersionId, keptName, and result (winner, control_wins, or no_clear_winner). Null otherwise.
holdbackPercent, provenFor a personalization test, the percent held back, and the result measured before the campaign rolled out to everyone. Null otherwise.

state is one of:

stateLabelMeaning
setupSetupA draft.
starts_on_publishStarts on PublishStarted in the draft. Visitors see Control until you publish.
collectingCollecting evidenceNo verdict yet.
winner_foundWinner foundA version has a 95% chance or more to beat Control.
control_winsControl winsEvery variant has a 5% chance or less to beat Control.
paused_healthPaused (health issue)Visitors weren't split as planned, or more than 5% saw more than one version. Restart the test to measure again.
paused_campaign_offPaused · campaign offThe test's campaign is off. Results so far are kept.
paused_unconfirmedPaused · publish unconfirmedRightMessage couldn't confirm when the last publish went live. Results resume on their own.
paused_not_livePaused · not on your siteVisitors can't see the question, offer, or flow test, as notLive explains. Results so far are kept.
ends_on_publishEnds on PublishEnded in the draft. Visitors stay in the test until you publish.
deployedDeployedAn ended Original page test whose kept version shows to everyone until it's undeployed.
finishedFinishedEnded. outcome says how.

Each versions item has arm (A for Control and B–E for variants, or holdback and personalized for a personalization test), id, name, weight, visitors, conversions, rate, difference, range, chance, result, resultLabel, value, valuePerVisitor, and revenueChance. rate, difference, range, chance, and revenueChance also come as rateText, differenceText, rangeText, chanceText, and revenueChanceText, formatted the way the dashboard prints them.

  • visitors count from each visitor's first exposure, and conversions count those who answered, completed, or converted within 7 days of it.
  • difference is relative to Control: 0.2 means 20% better, not 20 percentage points. range is its 95% likely range as {low, high}, such as "4% to 31% better".
  • chance is the version's chance to beat Control, or the held-back visitors for a personalization test.
  • result is baseline for Control, then winner (a 95% chance or more), did_worse (5% or less), no_clear_winner (the test ended short of both), or null while it collects.
  • value, valuePerVisitor, and revenueChance use the goal's conversion value. They never change result.

Verdicts are live: a chance can rise or fall as visitors arrive until the test ends. Only state and each version's result name a winner.

create-split-test

Creates a test record in draft status.

ArgumentTypeRequiredMeaning
project_idstringNoPublic project ID.
resource_typestringYesquestion, offer, or flow.
resource_idstringYesExisting resource ID.
variantsarray of objectsYesNonempty array using the payload rules above.
JSON
{"name":"create-split-test","arguments":{"project_id":"123456789","resource_type":"question","resource_id":"raq_example","variants":[{"id":"variant_b","name":"Direct question","weight":50,"text":"What would help your team most?"}]}}
JSON
{"pid":"987654321","resource_type":"question","resource_id":"raq_example","status":"draft","variants":[{"id":"variant_b","name":"Direct question","weight":50,"text":"What would help your team most?"}],"message":"Split test created in draft status. Use start-split-test to activate it."}

Creation immediately stores the test record but does not start or publish it. Missing fields, unsupported resource types, invalid weights, too many variants, a second draft or active test for the same question, offer, or flow, and invalid variant definitions return errors. Shared mutation failures use Validation error: ... or Operation failed: ....

list-split-tests

Lists stored tests, optionally filtered.

Arguments: optional project_id string; optional resource_type, resource_id, and status strings. Supported resource types are question, offer, and flow; normal status values are draft, active, and completed. For clarity, pair a resource ID with its type. The handler applies supplied filters independently.

JSON
{"name":"list-split-tests","arguments":{"project_id":"123456789","resource_type":"question","status":"draft"}}
JSON
[{"pid":"987654321","resource_type":"question","resource_id":"raq_example","status":"draft","variants":[{"id":"variant_b","name":"Direct question","weight":50,"text":"What would help your team most?"}],"started_at":null,"ended_at":null,"winner_id":null,"state":"setup","stateLabel":"Setup","needsDecision":false,"reportUrl":"https://app.rightmessage.com/123456789/split-tests/987654321","resource_name":"Business needs"}]

Each item contains pid, resource_type, resource_id, status, variants, started_at, ended_at, winner_id, and the test as the A/B testing page names it: state, stateLabel, needsDecision, and reportUrl (see A/B test results). Resolved resources can add resource_name. There are no pagination arguments. No matches returns []. This doesn't return results or alter a test. For every kind of A/B test with its results, use list-ab-tests.

get-split-test

Reads one test, its original content, and its result.

Arguments: optional project_id string and required split_test_pid string.

JSON
{"name":"get-split-test","arguments":{"project_id":"123456789","split_test_pid":"987654321"}}

Illustrative response excerpt:

JSON
{"pid":"987654321","resource_type":"question","resource_id":"raq_example","status":"draft","snapshot":null,"original_content":{"text":"What does your team need?","description":"","buttonText":"Continue","options":[]}}

The full response includes test metadata and variants described under listing, plus snapshot and result. original_content for a question contains text, description, buttonText, and options, whose items contain segmentId, label, and imageUrl. Offer original content contains title, description, buttonText, and imageUrl; link-action offers also include url and openInNewTab. A flow does not receive the same top-level original-content expansion.

Original content uses draft-first configuration for draft tests and published configuration for active/completed tests. A completion snapshot, when present, contains created_at, original_content, and metrics; question snapshots also preserve related segment information.

result is the test in the A/B test results shape, for every status. Its estimate is always null here; get-split-test-metrics returns a draft's estimate. This operation changes neither test state nor configuration.

get-split-test-metrics

Reads a question, offer, form, or flow test's results, the numbers its A/B testing report shows.

Arguments: optional project_id string and required split_test_pid string. There is no date-range or winner-selection argument.

JSON
{"name":"get-split-test-metrics","arguments":{"project_id":"123456789","split_test_pid":"987654321"}}

Illustrative response excerpt for a running question test:

JSON
{"id":"987654321","reportUrl":"https://app.rightmessage.com/123456789/split-tests/987654321","kind":"question","kindLabel":"Question test","name":"Business needs","state":"collecting","stateLabel":"Collecting evidence","needsDecision":false,"verdict":"Variant A is ahead with a 66% chance to beat Control. It needs 95% to win. About 1,100 more visitors at this rate.","metric":"answer_rate","metricLabel":"Answer rate","split":"50 / 50","versions":[{"arm":"A","id":"control","name":"Control","weight":50,"visitors":454,"conversions":159,"rate":0.3502,"rateText":"35.0%","chance":null,"chanceText":"—","result":"baseline","resultLabel":"Baseline"},{"arm":"B","id":"variant_b","name":"Variant A","weight":50,"visitors":454,"conversions":170,"rate":0.3744,"rateText":"37.4%","chance":0.66,"chanceText":"66%","result":null,"resultLabel":null}],"leader":"B","visitorsNeeded":{"visitors":908,"needed":2000,"neededText":"about 2,000"}}

The response is one test in the A/B test results shape. Drafts are included: a draft reads setup with its estimate, computed when you call. A test that tests something RightMessage no longer reports on returns This split test tests something RightMessage no longer reports on.

The tool doesn't choose a winner or change state. Check the visitor and conversion counts before ending a test early, since small samples swing more. For any kind of A/B test, with its chance over time and earlier runs, use get-ab-test.

list-ab-tests

Lists every A/B test in the project the way the A/B testing page does: tests that need a decision first, then running tests, drafts, and finished tests, newest first within each. Personalization tests are listed while they run.

ArgumentTypeRequiredMeaning
project_idstringNoPublic project ID.
kindstringNopersonalization, page, audience, question, offer, form, or flow. form is an offer with form fields; offer is every other offer.
statestringNoOne of the states in A/B test results.
limitintegerNoTests to return, 1–100. Default 25.
offsetintegerNoTests to skip. Default 0.
JSON
{"name":"list-ab-tests","arguments":{"project_id":"123456789","state":"winner_found"}}

The response has tests (each in the A/B test results shape), total (the filtered count), limit, offset, hasMore, counts, and computedAt, the oldest computation time among the results. counts counts every test by tab, whatever the filters: needDecision, running, drafts, and finished. A draft's estimate is null while it's still being computed; get-ab-test computes it at once. An unknown kind or state returns an error that lists the accepted values. This tool is read-only.

get-ab-test

Reads one A/B test of any kind, as its report shows it.

Arguments: optional project_id string and required test_id string: an ID from list-ab-tests. That's the campaign ID (cpn_…) for a campaign's personalization test, an abt_… ID for a page or audience test, or the split test pid.

JSON
{"name":"get-ab-test","arguments":{"project_id":"123456789","test_id":"abt_pricing"}}

The response is the test in the A/B test results shape, with a draft's estimate computed now, plus what the report charts:

  • series: each variant's chance to beat Control over time, one point a day, as {at, chances} with chances keyed by version arm. A missing or null arm is a gap, such as while the test was paused.
  • crossings: each time a version crossed the Winner bar (threshold 0.95) or the Did worse bar (0.05), with at, arm, direction (up or down), and the version name.
  • history: earlier runs, newest first, each with testId, run, startedAt, endedAt, outcome, and reportUrl. Restarting a test starts a fresh run, and the earlier run stays as Finished. outcome is null for a run recorded without a goal, which measured nothing.

An unknown ID returns A/B test … not found for project …. Use list-ab-tests for its tests. This tool is read-only. Only state and each version's result name a winner; don't read one from series.

update-split-test

Replaces the stored variants of a draft test. It is not a per-variant merge.

Arguments: optional project_id string; required split_test_pid string; variants array of objects. Although the advertised schema does not mark variants required, the handler rejects a request without it because there are no other editable fields.

JSON
{"name":"update-split-test","arguments":{"project_id":"123456789","split_test_pid":"987654321","variants":[{"id":"variant_b","name":"Short question","weight":50,"text":"What do you need most?"}]}}
JSON
{"pid":"987654321","resource_type":"question","resource_id":"raq_example","status":"draft","variants":[{"id":"variant_b","name":"Short question","weight":50,"text":"What do you need most?"}]}

Include every variant you want to retain. This overwrites stored test data immediately, but does not publish it. Active/completed tests return a state error; absent update data returns No update fields provided. Pass variants to update. Model validation still applies to question and offer variants. The update handler does not repeat all of creation's weight and flow-root checks, so clients should retain the valid creation contract rather than relying on weaker update validation.

start-split-test

Changes a draft test to active and records started_at.

Arguments: optional project_id string and required split_test_pid string.

JSON
{"name":"start-split-test","arguments":{"project_id":"123456789","split_test_pid":"987654321"}}
JSON
{"pid":"987654321","resource_type":"question","resource_id":"raq_example","status":"active","started_at":"2026-10-13T12:00:00Z","message":"Split test is now active. Visitors will be randomly assigned to variants."}

This is a consequential activation, not a private preview. Variants become locked, and a subsequent configuration publication can include the active test. The handler itself does not compile or publish the snippet. The response's active message describes stored test state, not proof that new code reached visitors. Until you publish, the test's A/B testing state is starts_on_publish.

An active question test also locks changes to the question's wording, answers, display, behavior, linked segment values, and non-sync Auto-Segment rules. This applies to other mutation tools and configuration restores too. Sync mappings, internal names, and flow membership can still change. End the test before attempting a locked edit.

Only draft tests can start. Confirm the intended resource and variants, then use the publication tools when ready to deploy. Publication can include other pending configuration changes.

end-split-test

Completes an active test and keeps Control or one stored variant.

Arguments: optional project_id string; required split_test_pid string and winner_id string. winner_id must be control or an existing variant ID.

JSON
{"name":"end-split-test","arguments":{"project_id":"123456789","split_test_pid":"987654321","winner_id":"control"}}
JSON
{"pid":"987654321","resource_type":"question","resource_id":"raq_example","status":"completed","winner_id":"control","ended_at":"2026-10-13T13:00:00Z","message":"Test ended, keeping Control. Nothing in the draft changed. Publish to stop the test on the site."}

Ending a test saves a completion snapshot and attempts to capture metrics. A metrics error leaves snapshot.metrics: null but does not by itself prevent completion. Test completion and promotion of a non-control winner either succeed together or fail together. A non-control winner overwrites supported question copy and answer wording, offer content and links, or the flow tree in the draft. Promoting a question's answer label can also change the corresponding segment name. Choosing control leaves original content unchanged but still completes the test record.

A kept variant replaces the prior editable content. The tool saves a configuration snapshot before promotion and notifies editors. It does not publish. Until you publish, the test reads ends_on_publish and visitors stay in it. Publish to show the kept version to everyone and remove the running test from the served configuration; the test then reads finished, and its results stay readable with get-ab-test.

Wrong state, unknown winner, invalid ID, or invalid promotion returns an error. Read get-split-test-metrics first, and let the customer choose what to keep. The tool description suggests the version the dashboard's End dialog preselects: Control when the test reads control_wins; otherwise the Winner with the highest chance; otherwise the leading version when its chance is above 50%; otherwise Control.

delete-split-test

Permanently deletes a draft or completed test record, including its stored completion snapshot.

Arguments: optional project_id string and required split_test_pid string.

JSON
{"name":"delete-split-test","arguments":{"project_id":"123456789","split_test_pid":"987654321"}}
JSON
{"deleted":true,"pid":"987654321"}

Active tests must be ended first. Deletion is immediate account-record removal, not a draft operation. Configuration undo cannot restore the test record, and deleting a completed test does not revert content already promoted or published. Missing/invalid IDs, unknown tests, and active-state deletion return errors.

Still need a hand?

Tell us what you’re trying to do and where you’re getting stuck.

support@rightmessage.com