Skip to main content

Overview

The Narrative MCP server exposes platform operations as tools that AI assistants can discover and call. All tool names use the narrative_ 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

https://mcp.narrative.io/mcp

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).
ParameterTypeRequiredDescription
(none)Returns the current user, role, and active-company selection
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.
ParameterTypeRequiredDescription
(none)Returns all companies for the current user
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.
ParameterTypeRequiredDescription
company_idintegerYesThe company to switch to

narrative_context_search_companies

Searches companies by name using case-insensitive substring matching. Available to global administrators only.
ParameterTypeRequiredDescription
search_termstringYesSearch term to match against company names
per_pageintegerNoResults per page (default: 50, max: 100)
Returns { id, name } for each matching company.

Dataset tools

Dataset tools let you search, describe, and inspect datasets. 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.
ParameterTypeRequiredDescription
search_termstringNoFuzzy-matched against dataset name, display_name, and description. Matches on name and display_name rank above description-only matches of equal strength. Does NOT match tags.
tagsstring[]NoExact-match all-of filter (case-sensitive). A dataset is returned only if it carries every supplied tag.
data_plane_idstring (uuid)NoRestrict to a single data plane. Use narrative_data_planes_list to discover ids.
includestring[]NoSections to include per match
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.
ParameterTypeRequiredDescription
dataset_idsinteger[]YesOne or more dataset ids to describe
includestring[]NoSections to include (default: ["metadata", "schema"])
formatstringNoResponse format: "markdown" (default) or "json"
Available include values:
ValueDescription
metadataName, id, description, owner
schemaColumn types and attribute mappings
mappingsRosetta Stone mappings on the dataset
sampleSample rows
statsDataset-level statistics (not per-column)
column_stats_configWhich columns have statistics configured
retention_policyData retention settings
nqlGenerated NQL snippet to query the dataset

narrative_dataset_get_column_stats

Returns per-column statistics for a single dataset.
ParameterTypeRequiredDescription
dataset_idintegerYesThe dataset to inspect
columnsstring[]YesColumn names to retrieve stats for
includestring[]NoStat types to include (default: ["basic_column_stats"])
formatstringNoResponse format: "markdown" (default) or "json"
Available include values:
ValueDescription
basic_column_statsAll statistics except histogram — safe for context budget
histogramOpt-in; can produce large responses on wide columns

narrative_dataset_set_column_stats_config

Configures which columns have statistics collected on a dataset.
ParameterTypeRequiredDescription
dataset_idintegerYesThe dataset to configure
configobjectYesColumn statistics configuration

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.
ParameterTypeRequiredDescription
dataset_idintegerYesThe dataset to sample
compute_pool_idstringNoTarget a specific compute pool; otherwise uses the dataset’s configured pool
Returns the job id. Poll completion with narrative_jobs_describe.

narrative_dataset_refresh_materialized_view

Triggers a refresh of a materialized-view dataset.
ParameterTypeRequiredDescription
dataset_idintegerYesThe materialized view dataset to refresh
typestringYes"full" (reprocess all snapshots) or "incremental" (skip already-processed snapshots)
compute_pool_idstringNoTarget a specific compute pool
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.
ParameterTypeRequiredDescription
dataset_idintegerYesThe dataset to recalculate stats for
from_snapshotstringNoStart from a specific snapshot; otherwise recalculates all snapshots in the stats configuration
Returns the recalculation id, queued snapshot count, and snapshot timestamp range.

Attribute tools

Attribute tools let you explore and inspect Rosetta Stone attributes. Searches Rosetta Stone attributes by name.
ParameterTypeRequiredDescription
search_termstringYesText to search across attribute names and descriptions
includestring[]NoSections to include (default: ["metadata"])
formatstringNoResponse format: "markdown" (default) or "json"
Available include values:
ValueDescription
metadataId, name, display name, description, type, tags
schemaProperties, required fields, enum values

narrative_attributes_describe

Describes one or more attributes by id. Accepts multiple attribute ids in a single call.
ParameterTypeRequiredDescription
attribute_idsinteger[]YesOne or more attribute ids to describe
includestring[]NoSections to include (default: ["metadata", "schema"])
formatstringNoResponse format: "markdown" (default) or "json"
Uses the same include values as narrative_attributes_search.

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. 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.
ParameterTypeRequiredDescription
search_termstringNoFuzzy-matched against name, display name, description, owning company name, and slug. Matches on name and display name rank above description / company matches of equal strength.
exposed_attribute_namesstring[]NoFilter to rules that expose any of these Rosetta Stone attributes (discover names via narrative_attributes_search)
tagsstring[]NoFilter to rules carrying any of these tags
dataset_idsinteger[]NoFilter to rules referencing any of these datasets
company_idsinteger[]NoFilter to rules owned by any of these companies
owned_onlybooleanNoRestrict to rules owned by the active company
shared_onlybooleanNoRestrict to rules shared with (but not owned by) the active company
includestring[]NoSections to include per match (default: ["description", "mappings"])
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:
ValueDescription
descriptionRule description
mappingsAttributes the rule exposes
tagsTags attached to the rule
dataset_idsDatasets the rule references
pricingPrice in CPM USD
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.
ParameterTypeRequiredDescription
access_rule_idsinteger[]YesOne or more access rule ids to describe
includestring[]NoSections to include (default: ["metadata", "mappings"])
Available include values:
ValueDescription
metadataName, display name, description, owning company, type, status, tags, dataset ids, timestamps
mappingsAttributes the rule exposes
nqlGenerated NQL snippet for the rule
schemaOutput schema as JSON
collaboratorsSharing and collaborator configuration
pricingPrice in CPM USD

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.
ParameterTypeRequiredDescription
querystringYesThe NQL query to validate
Use narrative_nql_validate to test Rosetta Stone mapping expressions cheaply. Validate a candidate expression by running SELECT expression FROM company_data."dataset_id" through the tool — if it compiles, the expression is valid against the dataset’s schema.

narrative_nql_run

Submits an NQL query for asynchronous execution. Supports SELECT queries and CREATE MATERIALIZED VIEW statements.
ParameterTypeRequiredDescription
querystringYesThe NQL query to execute
data_plane_idstringNoTarget a specific data plane; otherwise uses the company default
compute_pool_idstringNoTarget a specific compute pool; otherwise uses the company default
Returns a job descriptor in state: pending. Poll it with narrative_jobs_describe.

Job tools

Job tools let you discover and follow Narrative jobs — the asynchronous units of work spawned by narrative_nql_run, 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.
ParameterTypeRequiredDescription
job_idsstring[]YesOne or more job ids (up to 50 per call)
includestring[]NoSections to include (default: ["failures", "metadata", "result"])
Available include values:
ValueDescription
metadataState, type, timestamps, data plane, compute pool
resultThe job’s result payload (shape depends on job type)
failuresAny errors recorded against the job
inputThe original job input
compiled_sqlCompiled SQL (NQL-derived jobs only)
tagsTags attached to the job
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.
ParameterTypeRequiredDescription
tagsstring[]NoFilter by tag (exact-match, case-sensitive). Useful patterns: workflow_run_id=<run-uuid>, workflow_id=<workflow-uuid>
statestringNoOne of pending, running, completed, pending_cancellation, cancelled, failed
typestringNoJob-type filter (free-form, e.g. materialize-view, nql-forecast, datasets_sample)
dataset_idintegerNoOnly return jobs whose input references this dataset
data_plane_idstringNoData plane UUID
per_pageintegerNoItems per page (default: 25, max: 500)
offsetintegerNoNumber of records to skip. Use offset = page_index * per_page to walk pages
includestring[]NoSections to include per match (default: ["metadata"]; also accepts "tags")
Multiple filters compose with AND. Pass the returned ids to narrative_jobs_describe for full per-job detail.

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 optional data_plane_id argument on narrative_nql_run.

narrative_data_planes_list

Lists every data plane available to the active company, including Narrative-hosted and any company-owned planes.
ParameterTypeRequiredDescription
includestring[]NoSections to include per result (default: ["metadata"])

narrative_data_planes_describe

Describes one or more data planes by id. Accepts multiple ids in a single call and fetches them in parallel.
ParameterTypeRequiredDescription
data_plane_idsstring[]YesOne or more data plane UUIDs to describe
includestring[]NoSections to include (default: ["metadata"])
Available include values (shared by both data plane tools):
ValueDescription
metadataDisplay name, status, description, default compute pool, last heartbeat
compute_poolsCompute pools attached to the data plane
platformPlatform-specific configuration as JSON

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.
ParameterTypeRequiredDescription
specificationstringYesThe workflow YAML as a plain string
data_plane_idstringYesUUID of the data plane the workflow should run on. Use narrative_data_planes_list to discover ids
trigger_immediatelybooleanNoTrigger a run as soon as the workflow is created (default: false)
schedule_immediatelybooleanNoActivate the workflow’s schedule as soon as it is created (default: false)
tagsstring[]NoOptional tags to attach to the workflow
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.
ParameterTypeRequiredDescription
workflow_idstringYesUUID of the workflow to trigger
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.
ParameterTypeRequiredDescription
workflow_idsstring[]YesOne or more workflow UUIDs to describe
includestring[]NoSections to include (default: ["metadata"])
Available include values:
ValueDescription
metadataName, status, data plane, timestamps, tags, archived state
specificationFull workflow YAML — opt in, can be large
Avoid include=["specification"] when scanning many workflows. Request it only after you have narrowed to the ones you actually want to inspect.

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.
ParameterTypeRequiredDescription
workflow_idstringYesUUID of the workflow whose runs to list
per_pageintegerNoItems per page (default: 10)
page_tokenstringNoOpaque cursor from a previous response’s next_page_token. Omit for the first page
To find the jobs spawned by a specific run, call narrative_jobs_search with tags=["workflow_run_id=<run-uuid>"].

Usage patterns

The most effective pattern for running queries is validate → run → poll:
  1. Validate the query with narrative_nql_validate to catch syntax errors before enqueuing a job.
  2. Run the validated query with narrative_nql_run to submit it for execution.
  3. Poll with narrative_jobs_describe until the job reaches a terminal state.
This avoids enqueuing jobs that would fail at compile time and keeps long-running executions out of the synchronous request path.

Dataset inspection flow

To understand a dataset’s structure and content:
  1. Search with narrative_datasets_search to find datasets by name or description.
  2. Describe with narrative_datasets_describe using include=["metadata", "schema"] for an overview, or add "sample" and "stats" for deeper inspection.
  3. Inspect columns with narrative_dataset_get_column_stats for detailed per-column statistics.

Access rule discovery flow

To find and inspect the access rules available to your company:
  1. Search with narrative_access_rules_search, providing at least one filter (e.g. search_term, exposed_attribute_names, tags, dataset_ids).
  2. Describe shortlisted rules with narrative_access_rules_describe using include=["metadata", "mappings"] for an overview, or add "nql", "schema", "collaborators", or "pricing" for deeper detail.
  3. Reference in NQL using <owning_company_slug>.<access_rule_name>.

Workflow submission flow

To submit and track a workflow from an AI assistant:
  1. Discover available data planes with narrative_data_planes_list to pick a data_plane_id.
  2. Create the workflow with narrative_workflows_create, passing the YAML as specification. Set trigger_immediately=true to start a run right away, or call narrative_workflows_trigger later.
  3. Poll runs with narrative_workflow_runs_list until the most recent run reaches a terminal state.
  4. Inspect job-level progress by calling narrative_jobs_search with tags=["workflow_run_id=<run-uuid>"], then narrative_jobs_describe on the returned ids.
  5. Describe the workflow with narrative_workflows_describe to inspect its specification or current status.

Multi-company sessions

If you belong to multiple companies:
  1. List your companies with narrative_context_get_companies.
  2. Switch with narrative_context_set_company to set the active company.
  3. 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.

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