DocsDeveloper guidesBuild an index with an agent

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

Never invent an operation name, a parameter, a dataset id, a column name or a filter value. Every one of those is discoverable with a tool call, and a plausible guess produces a workflow that validates, runs, and is wrong. 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. 1

    Discover the building blocks

    list_operations returns every operation with its category — call it with no arguments for the full list, or pass a category like index_management to 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. 2

    Copy real wiring from an example

    get_example returns production-tested workflows. Pass several ids in example_ids and 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_30 is the whole answer; for anything whose selection and weighting run on separate schedules, fetch staggered_effective alongside it.

  3. 3

    Read the exact parameter schemas

    get_operations with the ids you intend to use. Examples show you correct wiring but not the full option set, and defaults matter — map_identifiers defaults to mapping symbol to id, create_index_weighting defaults to equal. Do this before writing parameters, not after a validation failure.

  4. 4

    Inspect the real data

    If the index touches a dataset, list_datasets for the ids and inspect_dataset for the schema and a sample. get_column_values gives the distinct values in a column — the fix for filtering on "Technology" when the data says "Information Technology" and silently matching nothing.

  5. 5

    Preview a fragment

    run_workflow runs 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. 6

    Look at the output properly

    inspect_run on 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. 7

    Validate the whole workflow

    validate_workflow checks the candidate index_parameters against the manifest and returns structured issues rather than a pass/fail. It enforces the structural rules — every flow starts with a trigger, the workflow includes create_index_holdings, every flow persists a result — plus the parameter schemas.

  8. 8

    Save a draft

    save_workflow with no workflow_id creates 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. 9

    Backtest

    run_backtest runs the historical simulation. It validates the workflow, launches the run, and immediately returns a bkt_... id — poll get_backtest until the status is completed or failed. It never creates a live index.

  10. 10

    Deploy

    deploy_index with confirm=true runs a full backtest, persists the history, and registers the index for continuous scheduled calculation. It returns the pending idx_... and bkt_... ids immediately — poll get_backtest; the deployed_index_id appears 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.

rebal_trigger
sec_ref
eod_snap
liq_filter
eod_hist
return_12m
rank_mom
top_50
universe
weights
holdings
US Momentum 50 — the workflow the golden path arrives at.
Drag to pan, and select a node to see its configuration.
  1. Quarterly aligned trigger to the preceding XNYS close.
  2. core_securities_reference for the US common-stock cross-section, i1_core_quote for market caps, filter for the top 200 by size.
  3. 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.
  4. rank descending, filter to the top 50.
  5. create_index_universe, create_index_weighting proportional on momentum_12m, create_index_holdings.

The tools that matter

list_operations

no sign-in
read-only
idempotent

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

FieldTypeDescription
categorystring
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

no sign-in
read-only
idempotent

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

FieldTypeDescription
example_idsarray
One or more example ids; several are fetched in one call.
example_idstring
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

no sign-in
read-only
idempotent

Returns the full parameter schema and output columns of the named operations, which is what setting their parameters correctly takes.

Arguments

FieldTypeDescription
operation_idsrequiredarray
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

read-only
idempotent

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

FieldTypeDescription
operationsstring
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.
timestring
'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

no sign-in
read-only
idempotent

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

FieldTypeDescription
index_parametersrequiredstring
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

writes
destructive

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

FieldTypeDescription
index_parametersrequiredstring
JSON string of the full index_parameters object.
workflow_idstring
Existing workflow id to update; omit to create a draft.
namestring
Optional display name override.
verifyboolean
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

writes

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

FieldTypeDescription
index_parametersrequiredstring
JSON string of the full index_parameters object.
start_timestring
Backtest start, 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM:SS' (defaults to index_parameters.start_time).
end_timestring
Backtest end, 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM:SS' (defaults to now).
verifyboolean
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

writes

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

FieldTypeDescription
workflow_idstring
Saved workflow id to deploy.
index_parametersstring
JSON string of index_parameters (alternative to workflow_id).
start_timestring
History start, 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM:SS'.
end_timestring
History end, 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM:SS' (defaults to now).
confirmboolean
Must be true to actually deploy.
verifyboolean
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.

ToolEffectGuard
run_backtestComputes and stores a backtest result. Creates no index.None needed — it is reversible in the sense that nothing depends on it.
save_workflowCreates a draft, or overwrites an existing workflow's operations.Marked destructiveHint: true so clients can prompt. Omitting workflow_id is always safe.
deploy_indexCreates a live index with real history and a live schedule.confirm=true is required. Without it, nothing happens.

deploy_index is a publication event

A deployed index has an id other people can reference and a schedule that keeps calculating after the conversation ends. Do not deploy to check whether something works — that is what 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 $ref in parameters with no matching entry in input. The reference does not create an edge, so the value is missing at run time. This is the most common wiring bug, and validate_workflow catches it.
  • Guessed column names. splitAdjClose, not split_adj_close. The universe table's identifier is security, not id. The optimizer outputs asset, not id. 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_values first.
  • 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_backtest gives the same numbers without creating anything.
  • Waiting on a long run. The launch tools never block — take the bkt_ id they return and poll get_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.