The golden path
The order of operations an agent should follow.
The server sends a set of instructions to the client on initialize, and MCP clients pass those to their model. The core of them is an ordering: the sequence of tool calls that takes an idea to a live index without wasting calls or producing something that validates but is wrong.
The order is not arbitrary. Each step is cheap enough to fail at, and fails in a way that tells the model what to fix, before the next step becomes expensive. This page is that ordering with the reasoning attached.
A portfolio of tickers is a short path
get_example("personal_portfolio"), swap
your tickers and weights into the literal rows of its map_identifiers step, then run_backtest and
get_backtest. The steps below are for everything else.get_example copy wiring from a real workflow (the catalog ships in the instructions)get_operations exact schemas — only for operations you add or re-parameterizeinspect_dataset real columns, real valuesget_column_valuesrun_workflow preview against real data (nothing saved)inspect_runvalidate_workflow optional draft check (the run tools validate on their own)save_workflow persist as a draftrun_backtest validates + simulates, returns a backtest_id immediatelyget_backtest poll: run summary (+ chart-sized series)deploy_index register a live index (confirm=true)
The steps
- 1
list_operations — find out what exists
Call it with no arguments for everything plus the category list, or pass a category to narrow. The point of starting here is negative: it establishes that the operation you were about to name from memory either exists or does not. An invented operation name is the single most common way an agent-built workflow fails, and it fails late.
- 2
get_example — copy wiring, do not invent it
list_examplesthenget_examplereturns production-tested workflows withindex_parameters_json— the full workflow as a JSON string. Reading one teaches the DAG shape faster than any schema does, because it shows how operations are actually chained rather than what each accepts in isolation. Pass several ids inexample_idsto fetch them in one call; that is cheaper than separate calls and useful when the index combines patterns from more than one example. - 3
get_operations — get the exact parameter schema
An example shows one valid parameterisation, not the full set. Before using an operation, fetch its spec so every parameter name and type is right. This is the step that catches the plausible-but-wrong parameter — the one that is accepted as an unknown key and silently does nothing.
- 4
inspect_dataset and get_column_values — look at the data
inspect_datasetwithview='schema'gives real column names and dtypes;view='stats'gives per-column distributions.get_column_valuesgives the distinct values in a column — the canonical way to discover the real sector, country or rating strings a filter has to match. Filteringsector == "Tech"when the data says"Information Technology"produces an empty universe and no error. - 5
run_workflow — preview against real data
Run a single operation, a sub-workflow or the whole workflow in preview mode. Source data is real; nothing is persisted. The response is a summary — columns, shape, a small sample — and the full outputs are cached for two hours, so
inspect_runandget_column_valuescan drill into them byrun_idandop_id.Why preview before validate. Validation checks structure: that the graph is wired legally and the parameters typecheck. It cannot tell you that a filter matched zero rows, that a score column is entirely null, or that a weighting is dominated by one name. Only running it does. A workflow that validates and produces nothing is the failure mode this step exists to catch.
- 6
validate_workflow — check structure before you save
Validates a candidate
index_parametersagainst the manifest and returns structured issues rather than a pass/fail. It is cheap and it is specific, which makes it the right last check before anything is written. Saving an invalid workflow leaves a broken draft behind for a human to find later; validating first keeps the failure inside the conversation. - 7
save_workflow — persist a draft
Without
workflow_id, this creates a new draft. With one, it updates a workflow your team owns in place — and if that workflow is live, its changed operations trigger a live reload. The tool always validates before writing and never changes stage, so saving cannot accidentally promote a draft to live.Save before backtesting so there is something durable to refer back to. A backtest run against inline parameters that only ever existed in a chat message is not reproducible.
- 8
run_backtest — simulate history
Runs the workflow over history and returns a performance summary. It never creates a live index, no matter how it is called.
Why backtest before deploy. Deploying is the point at which an index starts being calculated every session, gets an id that other systems can reference, and starts producing history someone may rely on. The backtest is the last opportunity to see the strategy's behaviour — returns, volatility, drawdown, turnover — at zero cost. Read it. Structural validity says nothing about whether the rule does what was intended.
The tool launches the run and immediately returns a
backtest_id; pollget_backtestuntil the status iscompletedorfailed.include_series=truewithmax_pointsreturns a chart-sized value series. When a poll arrives before the run finishes,get_backtestwaits briefly server-side before answering, so back-to-back polling is cheap. - 9
deploy_index — go live, with confirmation
Takes a saved
workflow_idor inlineindex_parameters, runs a full backtest, persists that history, and registers the index for continuous scheduled calculation.Why confirm is required.
confirm=trueis an explicit, separate argument so that deploying cannot happen as a side effect of a model reading "make me an index" as an instruction to ship. It forces the agent to state the intent deliberately, and gives the client a natural place to put a human in the loop. A safety gate also refuses to register an index that resolves to no holdings. The tool returns the pendingindex_idandbacktest_idimmediately — pollget_backtest(backtest_id);deployed_index_idappears there when it completes.
Structural rules
Three rules are enforced at validation. An agent that knows them up front saves a round trip.
- Every flow starts with a trigger operation. The trigger is what defines the schedule the index recalculates on.
- The workflow must include
create_index_holdings. Holdings — actual share counts — are what the value engine calculates from; a workflow that stops at weights produces no index. - Every flow must persist a result. A branch that computes something and drops it is treated as an error, not as dead code to ignore.
The $ref convention
Operations are wired together in two places, and both are required. In an operation's parameters, refer to an upstream output with {"$ref": "<op_id>.output#column"}. Separately, list that upstream operation in the operation's input array.
The redundancy is deliberate: input is what builds the DAG and determines execution order, while $ref is what binds a specific column into a specific parameter. Supplying the $ref alone is the classic mistake — the parameter points at an operation the engine has no reason to run first.
{"id": "weighting","operation": "create_index_weighting","input": [{ "$ref": "screen" }],"parameters": {"weighting_column": { "$ref": "screen.output#market_cap" }}}
A worked example
What the path looks like in practice, building a market-cap weighted index of the largest US technology companies. The narrative below is the sequence of tool calls, with what each one settles.
list_operations()— returns every operation with its category. The agent finds the trigger operations, the security-selection operations,create_index_weightingandcreate_index_holdings, and confirms it is not inventing names.list_examples(search="market cap")thenget_example(example_ids=["staggered_effective"])— a production workflow with the same shape. Itsindex_parameters_jsonshows the real wiring: trigger, then selection, then weighting, then holdings, withinputarrays and$refparameters already correct.get_operations(operation_ids=["create_index_weighting","create_index_holdings"])— exact parameter schemas for the two operations the agent will change, rather than assuming the example used every available option.get_column_values(column="sector", dataset_id="…")— the real sector strings. This is where"Tech"becomes"Information Technology". If the index is driven by a team dataset rather than reference data,list_datasetsandinspect_dataset(view="schema")come first.run_workflow(operations=…)with just the trigger and the selection step — a preview against real data, persisting nothing.inspect_run(view="shape")confirms the filter matched a sane number of securities rather than zero or everything.run_workflowagain with the weighting and holdings steps appended, theninspect_run(view="stats", column="weight")— checks the weight distribution is not dominated by a single name and that nothing is null.validate_workflow(index_parameters=…)— structure, wiring and manifest conformance. Returns issues to fix, not a bare failure.save_workflow(index_parameters=…)— persists a draft and returns aworkflow_id.run_backtest(index_parameters=…, start_time="2014-12-31")— returns abacktest_idimmediately.get_backtest(backtest_id, include_series=true)returns the performance summary and the downsampled series once complete. This is the point at which a human should look at the numbers.deploy_index(workflow_id="…", confirm=true)— full backtest, history persisted, index registered for scheduled calculation. Pollget_backtest(backtest_id)— it reportsdeployed_index_idwhen it lands.
Never invent, always discover