Build an index with an agent
The MCP golden path, end to end.
Everything in Build and backtest an index can be done by an agent talking to the MCP server, without a browser and without writing the JSON by hand. This guide is that same job — a US momentum index — done tool by tool.
The value is not that an agent types faster. It is that the tools make the expensive mistakes unavailable: the catalog is discoverable rather than guessable, real data can be inspected before a filter is written against it, a fragment can be previewed before the whole graph is run, and the one irreversible step needs explicit confirmation.
The rule that matters most
list_operations, get_operations, get_example, inspect_dataset and get_column_values
exist for exactly this.Connect
The server is remote streamable HTTP at https://mcp.indexone.io. Point your client at it and sign in with your Index One account, or send a team API key — Connect an agent has the configuration for Claude, Claude Code, ChatGPT, Cursor and VS Code. The free plan includes it. Once connected, tools/list returns 22 tools in five groups: discovery, inspection, index data, build, and ship. Only 3 of them write.
The golden path
- 1
Discover the building blocks
list_operationsreturns every operation with its category — call it with no arguments for the full list, or pass a category likeindex_managementto narrow. This is the authoritative catalog; it is the answer to "is there an operation that does X", and the absence of something from it is meaningful. - 2
Copy real wiring from an example
get_examplereturns production-tested workflows. Pass several ids inexample_idsand get them in one call — cheaper than one call each, and useful when the index combines patterns. For a long/short momentum index,long_short_130_30is the whole answer; for anything whose selection and weighting run on separate schedules, fetchstaggered_effectivealongside it. - 3
Read the exact parameter schemas
get_operationswith the ids you intend to use. Examples show you correct wiring but not the full option set, and defaults matter —map_identifiersdefaults to mappingsymboltoid,create_index_weightingdefaults toequal. Do this before writing parameters, not after a validation failure. - 4
Inspect the real data
If the index touches a dataset,
list_datasetsfor the ids andinspect_datasetfor the schema and a sample.get_column_valuesgives the distinct values in a column — the fix for filtering on"Technology"when the data says"Information Technology"and silently matching nothing. - 5
Preview a fragment
run_workflowruns an operation, a sub-workflow or a whole workflow in preview mode against real source data. Nothing is persisted. It returns per-operation state and an output summary — columns, shape, a small sample — which is how you discover the columns an operation actually produces rather than the ones you expected. - 6
Look at the output properly
inspect_runon the cached result:view: "schema"for columns and dtypes,"sample"for rows,"stats"for per-column count, nulls, mean, std, min, quartiles and max."stats"is how you find the factor that is skewed or dominating a composite score before it distorts a backtest. - 7
Validate the whole workflow
validate_workflowchecks the candidateindex_parametersagainst the manifest and returns structured issues rather than a pass/fail. It enforces the structural rules — every flow starts with a trigger, the workflow includescreate_index_holdings, every flow persists a result — plus the parameter schemas. - 8
Save a draft
save_workflowwith noworkflow_idcreates a draft owned by your team; with one, it updates that workflow in place. It validates first and never changes stage. Updating a live workflow's operations triggers a live reload, which is why the tool is marked destructive. - 9
Backtest
run_backtestruns the historical simulation. It validates the workflow, launches the run, and immediately returns abkt_...id — pollget_backtestuntil the status iscompletedorfailed. It never creates a live index. - 10
Deploy
deploy_indexwithconfirm=trueruns a full backtest, persists the history, and registers the index for continuous scheduled calculation. It returns the pendingidx_...andbkt_...ids immediately — pollget_backtest; thedeployed_index_idappears there when the run completes.
The result
Following that path for a momentum brief produces this graph. Every wiring decision in it — the trailing-return chain, the universe/weighting fork, the $ref shapes — was copied from the catalog examples rather than derived, which is the point of step two.
- Quarterly aligned trigger to the preceding XNYS close.
- core_securities_reference for the US common-stock cross-section, i1_core_quote for market caps, filter for the top 200 by size.
- i1_core_eod for price history bounded by the run time, then return for a 252-session trailing return with filter_time collapsing it to one row per security.
- rank descending, filter to the top 50.
- create_index_universe, create_index_weighting proportional on momentum_12m, create_index_holdings.
The tools that matter
list_operations
Lists the operations a workflow can use, with id, name, description and category. Call it with no arguments to see every operation and the category list, or pass a category to narrow the result. Use it to find building blocks before assembling a workflow.
Arguments
| Field | Type | Description |
|---|---|---|
category | string | Optional category filter, e.g. 'index_management'. |
curl -X POST "https://mcp.indexone.io" \-H "content-type: application/json" \-H "accept: application/json, text/event-stream" \-H "x-api-key: YOUR_API_KEY" \-d '{"jsonrpc": "2.0","id": 1,"method": "tools/call","params": {"name": "list_operations","arguments": {"category": "index_management"}}}'
get_example
Returns one or more example workflows to copy structure and wiring from. Each carries 'index_parameters_json', the full workflow as a JSON string.
Arguments
| Field | Type | Description |
|---|---|---|
example_ids | array | One or more example ids; several are fetched in one call. |
example_id | string | A single example id (prefer example_ids). |
curl -X POST "https://mcp.indexone.io" \-H "content-type: application/json" \-H "accept: application/json, text/event-stream" \-H "x-api-key: YOUR_API_KEY" \-d '{"jsonrpc": "2.0","id": 1,"method": "tools/call","params": {"name": "get_example","arguments": {"example_ids": ["staggered_effective","long_short_130_30"]}}}'
get_operations
Returns the full parameter schema and output columns of the named operations, which is what setting their parameters correctly takes.
Arguments
| Field | Type | Description |
|---|---|---|
operation_idsrequired | array | Operation ids to fetch, e.g. ['create_index_weighting']. |
curl -X POST "https://mcp.indexone.io" \-H "content-type: application/json" \-H "accept: application/json, text/event-stream" \-H "x-api-key: YOUR_API_KEY" \-d '{"jsonrpc": "2.0","id": 1,"method": "tools/call","params": {"name": "get_operations","arguments": {"operation_ids": ["create_index_weighting"]}}}'
run_workflow
Run a single operation, sub-workflow, or full workflow in PREVIEW mode (nothing is persisted; source data is real). Returns per-operation state and an output SUMMARY (columns, shape, small sample). Use it to test that a step works and to discover the real columns an operation produces, then inspect_run / get_column_values on the result. Omit 'operations' entirely to run the CURRENT CANVAS as-is (the cheap way to inspect the existing workflow's real data). Runs as of the canvas index's last close before today unless 'time' names another.
Arguments
| Field | Type | Description |
|---|---|---|
operations | string | JSON string: array of operation objects [{id, operation, parameters, input?}], or a whole workflow, which runs with its own sources and currency. Omit to run the current canvas unchanged. |
time | string | 'YYYY-MM-DD' (through that day's end, UTC) or 'YYYY-MM-DD HH:MM:SS'; defaults to the canvas index's last close before today (no canvas: yesterday's end, UTC). Runs the preview as of that past time, e.g. to check a step that acts only on certain dates; a dated run is not the write tools' verification run. |
curl -X POST "https://mcp.indexone.io" \-H "content-type: application/json" \-H "accept: application/json, text/event-stream" \-H "x-api-key: YOUR_API_KEY" \-d '{"jsonrpc": "2.0","id": 1,"method": "tools/call","params": {"name": "run_workflow","arguments": {"operations": "[{\"id\":\"t\",\"operation\":\"manual_trigger\",\"parameters\":{}}]"}}}'
validate_workflow
Validate a candidate workflow against the manifest (structure + wiring; nothing is executed). Returns structured issues. Optional early check while drafting — every tool that submits, backtests, saves or deploys a workflow validates automatically and returns the same issues.
Arguments
| Field | Type | Description |
|---|---|---|
index_parametersrequired | string | JSON string of the full index_parameters object. |
curl -X POST "https://mcp.indexone.io" \-H "content-type: application/json" \-H "accept: application/json, text/event-stream" \-H "x-api-key: YOUR_API_KEY" \-d '{"jsonrpc": "2.0","id": 1,"method": "tools/call","params": {"name": "validate_workflow","arguments": {"index_parameters": "{\"name\":\"My Index\",\"start_time\":\"2019-12-28 00:00:00\",\"operations\":[]}"}}}'
save_workflow
Persist a workflow for the caller's team. Without workflow_id: creates a new DRAFT workflow. With workflow_id: updates an owned workflow in place (a live workflow's changed operations trigger a live reload). Always validated AND preview-verified first (runtime problems bounce with hints; verify=false skips the preview); never changes stage.
Arguments
| Field | Type | Description |
|---|---|---|
index_parametersrequired | string | JSON string of the full index_parameters object. |
workflow_id | string | Existing workflow id to update; omit to create a draft. |
name | string | Optional display name override. |
verify | boolean | Default true: runs the full workflow once in preview to catch runtime problems (a column the upstream op doesn't output, filters matching nothing, runaway leverage, an empty index) and returns them as actionable issues before doing the work. Auto-skipped when this exact workflow already ran cleanly this session. Set false only to skip the preview deliberately. |
curl -X POST "https://mcp.indexone.io" \-H "content-type: application/json" \-H "accept: application/json, text/event-stream" \-H "x-api-key: YOUR_API_KEY" \-d '{"jsonrpc": "2.0","id": 1,"method": "tools/call","params": {"name": "save_workflow","arguments": {"index_parameters": "{\"name\":\"My Index\",\"start_time\":\"2019-12-28 00:00:00\",\"operations\":[]}"}}}'
run_backtest
Run a historical simulation of a workflow (index_parameters JSON). Validates AND runs the workflow once in preview first (structured issues + runtime errors with hints returned on failure — no separate validate_workflow or run_workflow call needed), then launches the run and immediately returns a backtest_id — poll get_backtest until status is 'completed' or 'failed'. Never creates a live index — use deploy_index.
Arguments
| Field | Type | Description |
|---|---|---|
index_parametersrequired | string | JSON string of the full index_parameters object. |
start_time | string | Backtest start, 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM:SS' (defaults to index_parameters.start_time). |
end_time | string | Backtest end, 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM:SS' (defaults to now). |
verify | boolean | Default true: runs the full workflow once in preview to catch runtime problems (a column the upstream op doesn't output, filters matching nothing, runaway leverage, an empty index) and returns them as actionable issues before doing the work. Auto-skipped when this exact workflow already ran cleanly this session. Set false only to skip the preview deliberately. |
curl -X POST "https://mcp.indexone.io" \-H "content-type: application/json" \-H "accept: application/json, text/event-stream" \-H "x-api-key: YOUR_API_KEY" \-d '{"jsonrpc": "2.0","id": 1,"method": "tools/call","params": {"name": "run_backtest","arguments": {"index_parameters": "{\"name\":\"My Index\",\"start_time\":\"2019-12-28 00:00:00\",\"operations\":[]}"}}}'
deploy_index
Create a LIVE index from a saved workflow_id or inline index_parameters: validates AND preview-verifies the workflow (runtime problems bounce with hints; verify=false skips the preview), then runs a full backtest, persists its history, and registers the index for continuous scheduled calculation. Requires confirm=true. Returns the pending index_id + backtest_id immediately — poll get_index(index_id) or get_backtest(backtest_id) until the index lands on 'live' or 'failed' (deployed_index_id appears in get_backtest when done).
Arguments
| Field | Type | Description |
|---|---|---|
workflow_id | string | Saved workflow id to deploy. |
index_parameters | string | JSON string of index_parameters (alternative to workflow_id). |
start_time | string | History start, 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM:SS'. |
end_time | string | History end, 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM:SS' (defaults to now). |
confirm | boolean | Must be true to actually deploy. |
verify | boolean | Default true: runs the full workflow once in preview to catch runtime problems (a column the upstream op doesn't output, filters matching nothing, runaway leverage, an empty index) and returns them as actionable issues before doing the work. Auto-skipped when this exact workflow already ran cleanly this session. Set false only to skip the preview deliberately. |
curl -X POST "https://mcp.indexone.io" \-H "content-type: application/json" \-H "accept: application/json, text/event-stream" \-H "x-api-key: YOUR_API_KEY" \-d '{"jsonrpc": "2.0","id": 1,"method": "tools/call","params": {"name": "deploy_index","arguments": {"workflow_id": "idx_bh7fgXWJMaa3","confirm": true}}}'
Which tools write
Everything else is annotated read-only. These are not, and a client should treat them differently.
| Tool | Effect | Guard |
|---|---|---|
run_backtest | Computes and stores a backtest result. Creates no index. | None needed — it is reversible in the sense that nothing depends on it. |
save_workflow | Creates a draft, or overwrites an existing workflow's operations. | Marked destructiveHint: true so clients can prompt. Omitting workflow_id is always safe. |
deploy_index | Creates a live index with real history and a live schedule. | confirm=true is required. Without it, nothing happens. |
deploy_index is a publication event
run_workflow and
run_backtest are for. If an agent is operating unattended, deploy_index is the call to gate behind a human.Where agents actually go wrong
- A
$refinparameterswith no matching entry ininput. The reference does not create an edge, so the value is missing at run time. This is the most common wiring bug, andvalidate_workflowcatches it. - Guessed column names.
splitAdjClose, notsplit_adj_close. The universe table's identifier issecurity, notid. The optimizer outputsasset, notid. Preview and read the schema. - Guessed filter values. A sector string that matches nothing produces an empty universe and a workflow that validates cleanly.
get_column_valuesfirst. - Unbounded date filters. A data operation reading a range without
{"$ref": "context.request_context.time"}sees the future at every historical step. The backtest looks excellent and means nothing. - Deploying to test.
run_backtestgives the same numbers without creating anything. - Waiting on a long run. The launch tools never block — take the
bkt_id they return and pollget_backtest.
After deployment
The index-data tools cover the read side: get_index for metadata, get_index_values, get_index_holdings, get_index_weightings and get_index_universe for the artifacts, and get_index_stats for cumulative and annualised return, annualised volatility and max drawdown. Those are also the tools an agent uses on someone else's public index — list_workflows with scope: "public" finds them.
Setting up a delivery is not an MCP operation; that is POST /deliveries or the console. See Set up a delivery.