meryn-mcp

v0.1.0
meryn-mcp Checked 3 days ago Published 1 month ago

MCP server for the meryn API — read your MMM results and launch runs from Claude

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

list_engines

List the MMM engines available (Robyn, Meridian, PyMC): which ones support per-market (geo) data and which have a budget allocator. Start here when you do not know what the account can do.

list_engine_params

The full configuration surface of one engine: every knob with its type, default, bounds and help text, plus the effort levels and the prior families it offers. This is the schema of the `config` object that create_model accepts — read it before building a config, because it is served live from the database and changes without a release.

ParameterTypeDescription
engine *stringEngine key, e.g. "robyn", "meridian" or "pymc".

list_projects

List the projects visible to this key, newest configuration first.

ParameterTypeDescription
limitstringMax projects to return.
offsetstringSkip this many.

get_project

One project with its node graph: the datasets, mappings, periods, models and allocators it holds, and which engines its level allows.

ParameterTypeDescription
project_id *stringNumeric project id.

list_models

List trained or configured models. Filter by `engine`, `status` ("configured", "processing", "completed", "error") or `project`.

ParameterTypeDescription
enginestringOnly this engine.
limitstringMax models to return.
offsetstringSkip this many.
projectstringOnly models of this project id.
statusstringOnly this status.

get_model

One model: its status, the period it trained on, its data frequency and its allocators.

ParameterTypeDescription
model_id *stringModel UUID.

get_model_metrics

Fit and attribution metrics for a model, as raw numbers plus a `units` map saying how to read each one. IMPORTANT: values flagged "fraction" are 0-1, not percentages; a `null` means not measured (never zero); and anything listed in `not_applicable` does not exist for that engine (Robyn has no MCMC, so it has no r-hat). Do not convert or fill these in.

ParameterTypeDescription
model_id *stringModel UUID.
geostringA market name, or "total" for the national row.
sol_idstringRobyn only: a specific Pareto solution. Defaults to the selected one.
splitstringOne of "all", "train", "validation", "test".

get_model_readiness

Whether this model is fit to make decisions with: a green/amber/red verdict and the findings behind it. IMPORTANT: `state` can be "pending" (the verdict has not been computed yet) or "not_evaluated" (it ran and could not measure anything). Neither of those means the model is good — do not report a model as sound without an "evaluated" state.

ParameterTypeDescription
model_id *stringModel UUID.

get_model_logs

Current stage, elapsed time and the last worker log lines of a run. Use this to follow a run you launched, or to find out why one failed. Pass `since` (ISO timestamp) to get only what is new.

ParameterTypeDescription
model_id *stringModel UUID.
sincestringISO timestamp; only newer lines.

list_model_runs

The last runs of a model: when each started and ended, and how it finished. Use it to tell "this never ran" from "this failed three times" — and to see how long a run of this size takes before launching another.

ParameterTypeDescription
model_id *stringModel UUID.

list_model_charts

Which chart datasets a model has, and WHICH AXIS they cut on — read this before asking for one, instead of guessing the parameter. `axis` is "geo" (pass a market name), "sol_id" (Robyn, which has hundreds of Pareto solutions but no markets) or null (nothing to choose). `national_only` lists the charts that cannot be cut by market at all, with the reason.

ParameterTypeDescription
model_id *stringModel UUID.
geostringMarket name. Only for engines whose axis is "geo"; omit for national.
sol_idstringRobyn only: a Pareto solution. Defaults to the one selected in the app.

get_model_chart

One chart dataset as rows, with a `units` map and `null_means` next to them: the contribution waterfall, the fit over time, response curves, adstock decay, convergence, credible intervals, the decomposition. Call list_model_charts first to see what this model has. IMPORTANT: if `national_only` is set, the rows are NATIONAL and not the market you asked for — say so rather than reporting them as that market. Values flagged "fraction" are 0-1, and a `null` means not measured, never zero.

ParameterTypeDescription
dataset *stringDataset name, from list_model_charts.
model_id *stringModel UUID.
geostringMarket name, for engines whose axis is "geo".
limitstringMax rows. Omit to get the whole series — a truncated chart looks complete.
offsetstringSkip this many rows.
sol_idstringRobyn only: a Pareto solution.

list_model_results

Which finer-grained result tables a model has. Use these when a chart is too aggregated for the question: the waterfall sums over every date, so "contribution of TV by week" is not in it, and the decomposition folds intercept, trend and seasonality into one baseline series.

ParameterTypeDescription
model_id *stringModel UUID.

get_model_results

One result table whole, with the market, the date and the Pareto solution as COLUMNS rather than parameters — one call gets the cube and you group it yourself. Paginated, so check `count` against what you received before concluding anything about totals.

ParameterTypeDescription
family *stringFamily name, from list_model_results.
model_id *stringModel UUID.
limitstringMax rows per page.
offsetstringSkip this many.

list_eda

The exploratory data analyses (EDA) in this account. EDA is not one of the MMM engines — it checks a dataset BEFORE training — so it lives on its own path and does not appear in list_models.

ParameterTypeDescription
limitstringMax to return.
offsetstringSkip this many.
statusstringFilter by status, e.g. "completed".

list_eda_charts

Which EDA datasets a run has (series, correlations, VIF, cost share, lagged correlations).

ParameterTypeDescription
eda_id *stringEDA UUID.
geostringMarket name; omit for the aggregate.

get_eda_chart

One EDA dataset as rows: the variables over time, the correlation pairs, the VIF per variable with its reading, the cost share, or the lagged correlations. Use this to judge whether a dataset is fit to train on — collinearity and flat channels are what make a model unusable later. IMPORTANT: omitting `geo` gives the AGGREGATE, which is computed on the panel collapsed by date, not the sum of the markets.

ParameterTypeDescription
dataset *stringDataset name, from list_eda_charts.
eda_id *stringEDA UUID.
geostringMarket name; omit for the aggregate.
limitstringMax rows. Omit for the whole series.
offsetstringSkip this many.

get_allocator

A budget allocation: its scenario, budget and the national lift it found.

ParameterTypeDescription
allocator_id *stringAllocator UUID.

get_allocator_channels

The per-channel budget split of one market cut: current vs optimal spend and response. Pass `geo` for a market; the default is the national row. The `totals` object leaves a response at null when any channel is missing it — that is not zero, and summing around it would present a partial as a total.

ParameterTypeDescription
allocator_id *stringAllocator UUID.
geostringMarket name, or "total".

get_allocator_efficiency

Current vs optimized per metric, with the improvement — every market cut at once, with `geo` as a column. IMPORTANT: read `total_means` before adding anything up. In PyMC the `total` rows ARE the sum of the markets (it optimises jointly); in Meridian each market is an independent optimisation and its rows do NOT add up to the total.

ParameterTypeDescription
allocator_id *stringAllocator UUID.
limitstringMax rows per page.
offsetstringSkip this many.

list_datasets

The uploaded CSVs of a project, with their row and column counts.

ParameterTypeDescription
project_id *stringNumeric project id.
limitstringMax to return.
offsetstringSkip this many.

list_mappings

The variable mappings of a dataset: which role each column plays, the date range of the file and the frequency measured from it. Read this to know what a model will actually train on.

ParameterTypeDescription
dataset_id *stringNumeric dataset id.
limitstringMax to return.
offsetstringSkip this many.

list_periods

The periods (date windows) defined on a mapping. A period id is what create_model requires — the window decides which rows train, and it is asked for explicitly rather than guessed.

ParameterTypeDescription
mapping_id *stringNumeric mapping id.
limitstringMax to return.
offsetstringSkip this many.

create_model

Create a model on an existing period. It does NOT start training: the model is left ready to run, so you can build and review a configuration safely. Build `config` from list_engine_params; anything you omit takes the default from the database. Upload and map a dataset in the web app first — this API does not do that step.

ParameterTypeDescription
engine *stringEngine key.
period_id *stringNumeric id of the period (Experiment) to train on.
configobjectObject of knob → value, as described by list_engine_params.
namestringOptional name. A default naming the engine is used otherwise.

run_model

Start training a configured model. COSTS COMPUTE: tens of minutes of Cloud Run and one concurrent-run slot of the plan. Returns immediately; follow it with get_model_logs. A model already running returns 409 — do not retry it.

ParameterTypeDescription
confirm *booleanMust be true. Launching costs real compute (tens of minutes of Cloud Run) and uses one of the team plan concurrent-run slots, so it is never implicit: ask the user before setting it.
model_id *stringModel UUID.

cancel_model_run

Stop a queued or running model and leave it ready to run again. Cancelling is a request, not a kill: the container can take a few seconds to stop, and it saves nothing from the cancelled run.

ParameterTypeDescription
model_id *stringModel UUID.

create_allocator

Create a budget allocation on a trained model. Does NOT run it. Which scenarios exist, and which of them need a target instead of a budget, comes from list_engine_params for `<engine>_allocator`.

ParameterTypeDescription
end_date *stringISO date of the window end.
model_id *stringUUID of the trained model to optimise.
name *stringName for this allocation.
start_date *stringISO date of the optimisation window start.
channel_constraintsobjectOptional per-channel bounds envelope.
optimization_scenariostringScenario key, e.g. "max_response" or "fixed_budget".
optimize_by_geostringPer-market optimisation. Meridian and PyMC only, and it means a different thing in each: PyMC moves budget between markets, Meridian runs one optimisation inside each.
target_valuestringTarget, for target scenarios.
total_budgetstringBudget to allocate, for budget scenarios.

run_allocator

Run a configured budget allocation. COSTS COMPUTE, though much less than training. Returns immediately.

ParameterTypeDescription
allocator_id *stringAllocator UUID.
confirm *booleanMust be true. Launching costs real compute (tens of minutes of Cloud Run) and uses one of the team plan concurrent-run slots, so it is never implicit: ask the user before setting it.