Overview
The Narrative MCP server exposes platform operations as tools that AI assistants can discover and call. All tool names use thenarrative_ prefix. This page documents every available tool, its parameters, and usage patterns.
For setup instructions, see Connecting to the Narrative MCP Server. For background on how the server works, see MCP Server for Agents.
Server URL
Context tools
Context tools manage your authenticated session and company scope.narrative_context_get
Returns the current session context: authenticated user, role, and active company (if one has been set).
Use this to confirm which company is active before running queries or operations. If no company is set, follow up with
narrative_context_set_company.
narrative_context_get_companies
Lists the companies the authenticated user belongs to.
Returns each company’s id and name. Use this to discover which companies you can switch to.
narrative_context_set_company
Switches the active company for the current session. All subsequent tool calls operate against the selected company until changed.
narrative_context_search_companies
Searches companies by name using case-insensitive substring matching. Available to global administrators only.
Returns
{ id, name } for each matching company.
Dataset tools
Dataset tools let you search, describe, and inspect datasets.narrative_datasets_search
Finds datasets by fuzzy keyword match, tags, or data plane. At least one filter must be supplied — calling with no filters returns an error rather than the full corpus. Filters compose with AND.
Returns at most 50 ranked matches. If the response indicates more matches exist, narrow the filters and retry. For full metadata on a shortlisted dataset, call
narrative_datasets_describe with its id.
narrative_datasets_describe
Describes one or more datasets with configurable detail levels. Accepts multiple dataset ids in a single call and fetches them in parallel.
Available
include values:
narrative_dataset_get_column_stats
Returns per-column statistics for a single dataset.
Available
include values:
narrative_dataset_set_column_stats_config
Configures which columns have statistics collected on a dataset.
Dataset operation tools
These tools trigger asynchronous operations on datasets. All return a job or operation id that you can poll for completion.narrative_dataset_request_sample
Enqueues a sampling job for a dataset.
Returns the job id. Poll completion with
narrative_jobs_describe.
narrative_dataset_refresh_materialized_view
Triggers a refresh of a materialized-view dataset.
Returns the refresh job id. Poll completion with
narrative_jobs_describe.
narrative_dataset_recalculate_statistics
Enqueues a column-statistics recalculation across the dataset’s snapshot range.
Returns the recalculation id, queued snapshot count, and snapshot timestamp range.
narrative_dataset_update
Updates the safe, curator-editable metadata of a dataset: display name, description, and tags. Wraps PUT /datasets/:id. Structural fields (name, schema, write mode) are never editable through this tool.
At least one of
display_name, description, add_tags, or remove_tags must be provided. Omitted fields are left unchanged (partial update).
Tags are edited additively: the tool reads the dataset’s current tags, applies add_tags and remove_tags, then writes the resulting set. A small set of platform-managed system tags — _nio_view, _nio_inference, _nio_cached_mapping, _nio_materialized_view, and _nio_refresh_use_workflow — are immutable and silently ignored if included in add_tags or remove_tags; any other tag (including custom _nio* tags) is caller-controlled. pending datasets accept updates to all safe fields; active datasets accept display name, description, and tags; archived datasets reject any update.
The upstream endpoint currently treats an empty tag list as a no-op, so a
remove_tags that would clear the dataset’s last remaining tag is rejected with a clear error rather than silently ignored.Attribute tools
Attribute tools let you explore, inspect, and create Rosetta Stone attributes.narrative_attributes_search
Searches Rosetta Stone attributes by name.
Available
include values:
narrative_attributes_describe
Describes one or more attributes by id. Accepts multiple attribute ids in a single call.
Uses the same
include values as narrative_attributes_search.
narrative_attribute_create
Creates a new attribute owned by the currently selected company. Wraps POST /attributes.
The
type_definition argument accepts one of these shapes:
- Scalar types —
{ "type": "string" | "long" | "double" | "boolean" | "timestamptz" }.stringandlongaccept an optionalenumof allowed values. All scalars accept optionalvalidations: Spark SQL boolean expressions over$thisthat a value must satisfy (e.g."$this >= 0"). - Object types —
{ "type": "object", "properties": { <name>: <type definition>, ... }, "required": [ <name>, ... ] }. Nest additional type definitions insideproperties. - Array types —
{ "type": "array", "items": <type definition> }.
Access rule tools
Access rule tools let you discover and inspect access rules — the permissions and pricing controls applied to datasets — that your company owns or has been granted.narrative_access_rules_search
Searches access rules the active company has access to. At least one filter must be provided; calling with no filters returns an error rather than dumping the full corpus.
Filters compose with
AND. Matches are ranked by fuzzy score with name-side fields weighted above description and company fields, and truncated with an explicit note when the cap fires; refine the filters if you see the truncation message.
Available include values:
To reference a rule in NQL, use
<owning_company_slug>.<access_rule_name>.
narrative_access_rules_describe
Describes one or more access rules by id. Accepts multiple ids in a single call and fetches them in parallel.
Available
include values:
Mapping tools
Mapping tools let you create Rosetta Stone mappings from datasets to attributes in the active company.narrative_mapping_create
Creates a private mapping from a dataset to an attribute in the currently selected company. The mapping defines how each of the attribute’s properties is built from a row of the source dataset, using NQL expressions over the dataset’s columns.
The
mapping argument accepts one of three shapes:
object_mapping— for attributes whose value is an object. Supplytype: "object_mapping"andproperty_mappings, a list of{ path, expression }entries wherepathis a dotted path to an attribute property (e.g.product.brand) andexpressionis an NQL expression over dataset columns (e.g.itemBrand). Provide a mapping for each of the attribute’s required properties. Quote string literals like'SKU'.value_mapping— for scalar attributes. Supplytype: "value_mapping"and a singleexpressionthat produces the attribute’s value.cached_mapping— compiles into a dataset join at query time. Supplytype: "cached_mapping"and one or moreinput_expressions— NQL expressions over the source dataset’s columns that form the join key. The cache dataset is created automatically when the mapping is created, so nocache_dataset_idis supplied. Not permitted on opt-out attributes (data_privacy_request_identifier,unique_id,identifier_relation). Seecached_mappingfor details.
Connector tools
Connector tools let you inspect a company’s installed apps and create connections that route dataset data to external connectors. See the connection creation flow below for the recommended order.narrative_installations_list
Lists the apps installed by the currently selected company and flags which ones are connectors. Apps whose categories include destination_connector can receive dataset data through a connection; model_connector apps connect models instead and do not accept dataset connections.
Each result shows the installation id, the app id, the app’s name, and its categories. Use the installation id with
narrative_app_profiles_list to find the profile a connection is created against.
narrative_app_profiles_list
Lists the profiles of an app installation in the currently selected company. A profile’s id is the profile_id that a dataset connection is created against, and only profiles with status enabled can back a connection.
If no enabled profile exists, the user must create and enable one in the app’s UI before a connection can be created.
narrative_app_interfaces_list
Lists a connector app’s interfaces and their quick-settings JSON Schemas. Use the returned schema to construct the quick_settings object that narrative_connection_create accepts. Interface ids match the ones narrative_dataset_get_compatible_interfaces reports.
Available
include values:
narrative_dataset_get_compatible_interfaces
Reports which installed connector interfaces accept a dataset’s schema. Run this before narrative_connection_create: an accepted (app_id, interface_id) pair means that connector can receive the dataset’s data.
Available
include values:
Returns two sections:
Accepted — the interfaces that can receive the dataset — and Incompatible — the ones that rejected the schema.
narrative_connection_create
Creates a connection from a dataset to a connector app, routing the dataset’s data to that destination.
Returns the created connection’s id, app, dataset, profile, status, and creation timestamp. The connector validates the schema again at create time and rejects datasets that no longer match an interface.
NQL tools
NQL tools let you validate, execute, and track NQL queries.narrative_nql_validate
Compile-checks an NQL query without executing it. Returns the compiled SQL on success, or validation errors pointing to the offending part of the query.
narrative_nql_execute
Submits an NQL query to POST /v1/nql/execute for asynchronous execution. Supported statements are INSERT, UPDATE, DELETE, EXPLAIN, and CREATE MATERIALIZED VIEW; SELECT and MERGE are rejected.
Returns the id of the workflow that runs the query and the id of the workflow run. Poll the run with
narrative_workflow_runs_list(workflow_id=...), find the enqueued job with narrative_jobs_search(workflow_run_id=...), then read the result with narrative_jobs_describe.
The tool was previously named
narrative_nql_run. The old name is still accepted and transparently routed to narrative_nql_execute, but new integrations should call narrative_nql_execute directly.Job tools
Job tools let you discover and follow Narrative jobs — the asynchronous units of work spawned bynarrative_nql_execute, dataset operations, and workflow runs. Jobs are generic across types; the type field on each response distinguishes nql-forecast, materialize-view, datasets_sample, and others.
narrative_jobs_describe
Describes one or more jobs by id in a single call. Use this to poll jobs through to completion — re-invoke until each job’s state is completed, failed, or cancelled.
Available
include values:
narrative_jobs_search
Searches jobs by tags, state, type, dataset, or data plane. At least one filter must be supplied — calling with no filters returns an error rather than dumping the full corpus.
Pass the returned ids to
narrative_jobs_describe for full per-job detail. To find workflow-enqueued jobs, filter with workflow_run_id or workflow_id rather than the older tag convention.
Data plane tools
Data plane tools let you discover the data planes your company has access to. The ids returned here are used by workflow tools and the optionaldata_plane_id argument on narrative_nql_execute.
narrative_data_planes_list
Lists every data plane available to the active company, including Narrative-hosted and any company-owned planes.
narrative_data_planes_describe
Describes one or more data planes by id. Accepts multiple ids in a single call and fetches them in parallel.
Available
include values (shared by both data plane tools):
Both tool descriptions carry usage guidance for connected AI assistants: compute pools with
always_on: true skip cold-start cluster spin-up, making small always-on pools ideal for lightweight jobs like narrative_dataset_request_sample.
Workflow tools
Workflow tools let you submit, inspect, and track runs of workflows. The workflow YAML is passed as a free-form string — see the workflow task reference for the YAML shape.narrative_workflows_create
Submits a new workflow from a YAML specification.
Returns the created workflow’s id and metadata. When
trigger_immediately=true, the response also includes a run_id you can poll with narrative_workflow_runs_list.
narrative_workflows_trigger
Triggers a new run of an existing workflow. Returns immediately with the new run’s id; poll the run’s status via narrative_workflow_runs_list.
Workflows created through this tool are automatically tagged with
created_by_mcp_server so you can filter and audit agent-created workflows in the Narrative app. If the agent supplies the tag explicitly, it is not duplicated.narrative_workflows_describe
Describes one or more workflows by id. Accepts multiple ids in a single call and fetches them in parallel.
Available
include values:
narrative_workflow_runs_list
Lists runs of a single workflow, in the order the upstream returns them (typically most recent first). Mirrors the upstream paging surface — opaque cursor pagination via page_token.
To find the jobs spawned by a specific run, call
narrative_jobs_search with workflow_run_id=<run-uuid>.
Usage patterns
Recommended NQL flow
The most effective pattern for running queries is validate → execute → poll:- Validate the query with
narrative_nql_validateto catch syntax errors before enqueuing a workflow. - Execute the validated query with
narrative_nql_executeto submit it. The tool returns the workflow id and run id. - Poll the run with
narrative_workflow_runs_list(workflow_id=...)until it reaches a terminal state, then usenarrative_jobs_search(workflow_run_id=...)andnarrative_jobs_describeto read the result.
Dataset inspection flow
To understand a dataset’s structure and content:- Search with
narrative_datasets_searchto find datasets by name or description. - Describe with
narrative_datasets_describeusinginclude=["metadata", "schema"]for an overview, or add"sample"and"stats"for deeper inspection. - Inspect columns with
narrative_dataset_get_column_statsfor detailed per-column statistics.
Access rule discovery flow
To find and inspect the access rules available to your company:- Search with
narrative_access_rules_search, providing at least one filter (e.g.search_term,exposed_attribute_names,tags,dataset_ids). - Describe shortlisted rules with
narrative_access_rules_describeusinginclude=["metadata", "mappings"]for an overview, or add"nql","schema","collaborators", or"pricing"for deeper detail. - Reference in NQL using
<owning_company_slug>.<access_rule_name>.
Workflow submission flow
To submit and track a workflow from an AI assistant:- Discover available data planes with
narrative_data_planes_listto pick adata_plane_id. - Create the workflow with
narrative_workflows_create, passing the YAML asspecification. Settrigger_immediately=trueto start a run right away, or callnarrative_workflows_triggerlater. - Poll runs with
narrative_workflow_runs_listuntil the most recent run reaches a terminal state. - Inspect job-level progress by calling
narrative_jobs_searchwithworkflow_run_id=<run-uuid>, thennarrative_jobs_describeon the returned ids. - Describe the workflow with
narrative_workflows_describeto inspect its specification or current status.
Connection creation flow
To route a dataset’s data to a destination connector from an AI assistant:- List installed connectors with
narrative_installations_listand pick one whose categories includedestination_connector. - Find an enabled profile with
narrative_app_profiles_liston the installation id. Onlyenabledprofiles can back a connection. - Check compatibility with
narrative_dataset_get_compatible_interfacesfor the target dataset. The accepted(app_id, interface_id)pairs are the ones a connection will succeed against. - Build
quick_settings(optional) withnarrative_app_interfaces_liston the accepted interface’s app to retrieve the interface’s quick-settings JSON Schema. - Create the connection with
narrative_connection_create, passingdataset_id, the enabledprofile_id, and anyquick_settings.
Multi-company sessions
If you belong to multiple companies:- List your companies with
narrative_context_get_companies. - Switch with
narrative_context_set_companyto set the active company. - All subsequent tool calls operate against the selected company until you switch again.
Naming conventions
- Plural names (
datasets_describe,attributes_describe) accept multiple ids per call. - Singular names (
dataset_get_column_stats,dataset_request_sample) operate on a single entity. - All tools use the
narrative_prefix.
Related content
Connecting to the Narrative MCP Server
Set up your MCP client
Data Collaboration MCP Server
How the MCP server works
NQL Design Philosophy
Understand the query language behind NQL tools
Rosetta Stone
The schema normalization system behind attribute tools

