pex

MCP Tools Reference

The Apex MCP server exposes 23 tools organized into four categories. Each tool follows a conversational pattern — the agent presents options and waits for your confirmation before taking action.

Intelligence Tools

These tools help you reason about what to build and test before writing code.

plan_experiment

Analyzes a goal against existing beliefs and experiments. Returns structured options for the user to choose from. Does not create anything.

ParameterTypeDescription
goalrequiredstringWhat you want to improve or test (e.g. 'improve signup conversion on landing page').
targetUrlstringURL of the page to test, if known.

start_reasoning

Records a belief and hypothesis chain. Call after the user has selected a belief statement and confidence level from plan_experiment's options.

ParameterTypeDescription
decisionrequiredstringWhat you want to improve or change.
beliefrequiredstringThe assumption — must be confirmed by the user.
confidencerequirednumberHow sure the user is about this assumption (0–100%).

create_belief

Records an assumption your team is making. Confirm the statement and confidence with the user before calling.

ParameterTypeDescription
statementrequiredstringThe assumption statement.
confidencerequirednumberHow sure you are (0–100%).
parentBeliefIdstringID of a parent assumption, if this is a sub-assumption.

suggest_experiment

Returns smart experiment suggestions based on your beliefs, past experiments, and confidence gaps.

ParameterTypeDescription
contextstringWhat you're working on (e.g. 'redesigning onboarding', 'pricing page optimization').

predict_impact

Decision guardrail — predicts the impact of a proposed change by searching history for similar experiments.

ParameterTypeDescription
descriptionrequiredstringDescription of the proposed change (e.g. 'increase signup form fields from 3 to 5').

evaluate_feature

Pre-build intelligence — evaluates a feature idea against the belief graph, past experiments, and intelligence score.

ParameterTypeDescription
featurerequiredstringDescription of the feature you're considering building.
targetMetricstringThe metric you expect this feature to improve (e.g. 'conversion_rate').

log_prediction

Logs a prediction about a metric change. Feeds the calibration loop to track your team's forecasting accuracy over time.

ParameterTypeDescription
metricrequiredstringThe metric being predicted (e.g. 'conversion_rate').
expectedChangerequirednumberExpected change as a decimal (e.g. 0.15 for +15%).
confidencerequirednumberHow sure you are about this prediction (0–100%).
timeHorizonnumberDays until the prediction should be evaluated. Default: 14.
hypothesisIdstringID of the linked hypothesis.
beliefIdstringID of the linked assumption.

record_outcome

Logs the outcome of an experiment and updates belief confidence via Bayesian inference.

ParameterTypeDescription
experimentIdrequiredstringThe experiment ID.
beliefIdrequiredstringThe assumption ID to update.
outcomerequired"confirmed" | "contradicted" | "inconclusive"Whether the expected outcome happened.
metricDeltarequirednumberThe observed metric change (e.g. 0.15 for +15%).
notesstringOptional notes about the outcome.

Experiment Tools

These tools manage the full experiment lifecycle — from creation to completion.

create_experiment

Creates an experiment record and returns a recipe for the agent to implement. Always called with preview: true first so the user sees a summary before committing.

ParameterTypeDescription
namerequiredstringExperiment name.
targetUrlrequiredstringURL of the page to test.
controlContentrequiredstringThe current content (control).
variantContentrequiredstringThe new content (variant).
targetComponentstringComponent or file path where the change should be made.
trafficSplitnumberPercentage of traffic to control (1–99). Default: 50.
beliefIdstringID of the assumption this tests.
mode"sdk" | "snippet"Experiment mode. Default: sdk.
previewbooleanIf true, returns a preview without creating. Default: true.

activate_experiment / pause_experiment / archive_experiment

Lifecycle controls. Each takes a single experimentId parameter and asks the user for confirmation before acting.

list_experiments

Lists experiments, filtering by status. Archived experiments are hidden by default.

ParameterTypeDescription
statusstringFilter: 'all', 'running', 'completed', 'draft', 'paused', or 'archived'. Defaults to all except archived.

get_results

Returns detailed results for a specific experiment including visitor counts, conversion rates, and confidence.

promote_winner

Marks the winning variant and completes the experiment. For SDK experiments, returns code cleanup instructions.

ParameterTypeDescription
experimentIdrequiredstringThe experiment ID.
winnerrequired"control" | "variant_b"Which variant won.

Tracking Tools

These tools handle event ingestion, identity resolution, and deployment monitoring.

track_event

Tracks a custom event — identical to the SDK's track() and the snippet's apex.track().

ParameterTypeDescription
eventrequiredstringEvent name (e.g. 'page_view', 'form_submit', 'cta_click').
propertiesobjectEvent properties (url, formId, variant, etc.).

identify_user

Identifies a user by email for identity stitching. Links anonymous visitors to known leads.

ParameterTypeDescription
emailrequiredstringUser email address.
namestringUser name.
companystringCompany name.
metadataobjectAdditional traits.

track_deployment / check_deployment

Records that experiment code has been pushed (track_deployment) and verifies it's live (check_deployment). Both take an experimentId; track_deployment also requires commitSha.

Context Tools

These tools manage which organization and project you're working with.

list_orgs

Lists all organizations you have access to, with their projects. Requires a user key (apex_uk_).

switch_org

Switches the active organization. Also switches to the first project in that org.

ParameterTypeDescription
orgIdrequiredstringThe organization ID to switch to (from list_orgs).

list_projects

Lists all projects available to your API key. Shows which project is currently active.

switch_project

Switches the active project for the current session.

ParameterTypeDescription
projectKeyrequiredstringThe project key to switch to.

Next Steps