Skip to content

MCP tools ​

reportd serves the Model Context Protocol at /mcp (mcp.path), so an agent can design and render reports. Every tool calls the HTTP API as the caller, so roles, locks, the agent policy (agents.publish), the edit log and the audit apply as they do to people. Tool calls are limited by mcp.rateLimitPerMinute (Configuration).

ToolWhat it does
list_reportsList reports
get_reportGet a report
get_outlineGet a report's outline
get_language_referenceRFML language reference
list_componentsList components
get_sample_dataGet sample data
validate_reportValidate a report
run_testsRun a report's tests
preview_reportPreview a report
list_data_sourcesList data sources
get_data_sourceGet a data source
get_report_paramsGet a report's parameters
list_environmentsList environments
report_historyReport history
edit_reportEdit a report
undo_editUndo an edit
put_sampleWrite sample data
create_reportCreate a report
publish_reportPublish a report
promote_reportPromote a report
rollback_reportRoll back a report

list_reports ​

Lists every report in the catalog with its id, title and folder.

Read-only, safe to repeat.

No arguments.

get_report ​

Returns a report's RFML document, its draft revision (pass it to edit_report as baseRevision) and the names of its bundle files (samples, schemas).

Read-only, safe to repeat.

ArgumentTypeRequiredDescription
draftbooleanRead the draft (true, the default) or the published copy (false). Without a draft, the published copy is used.
environmentstringEnvironment name, as list_environments returns. Defaults to the first (the development environment).
idstringyesReport id: the document's id, lower-case letters, digits and hyphens.

get_outline ​

Returns the report's node tree (page templates and body) with ids, types, labels and locks. Use the ids as targets in edit_report.

Read-only, safe to repeat.

ArgumentTypeRequiredDescription
draftbooleanRead the draft (true, the default) or the published copy (false). Without a draft, the published copy is used.
environmentstringEnvironment name, as list_environments returns. Defaults to the first (the development environment).
idstringyesReport id: the document's id, lower-case letters, digits and hyphens.

get_language_reference ​

Without part: how this server works (environments, drafts, edits, publishing) and which schema parts exist. With part: the generated JSON Schema for document, ops, node:<type> (e.g. node:table), library or source-def.

Read-only, safe to repeat.

ArgumentTypeRequiredDescription
partstringSchema part: document, ops, node:<type>, library or source-def.

list_components ​

Lists the components the environment's libraries export: each with its library, version, the import that brings it in (add it to the document's imports, e.g. {"from": "library:billing", "version": "^2.1.0", "components": ["remittance-slip"]}) and its definition (description, props schema, slots). With id, also the components the report defines itself and the libraries it imports.

Read-only, safe to repeat.

ArgumentTypeRequiredDescription
draftbooleanRead the draft (true, the default) or the published copy (false). Without a draft, the published copy is used.
environmentstringEnvironment name, as list_environments returns. Defaults to the first (the development environment).
idstringReport id, to include the report's own components and imports. Optional.
librarystringOnly this library's components.

get_sample_data ​

Returns the report's sample data files (samples/*.json), keyed by bundle path. The document's data section says which dataset reads which file.

Read-only, safe to repeat.

ArgumentTypeRequiredDescription
environmentstringEnvironment name, as list_environments returns. Defaults to the first (the development environment).
idstringyesReport id: the document's id, lower-case letters, digits and hyphens.
pathstringOne file, e.g. samples/invoice.json. Omit for all of them.

validate_report ​

Checks the draft (structure, references, expressions against the dataset schemas) and returns RFML diagnostics with codes, node ids and suggested fixes.

Read-only, safe to repeat.

ArgumentTypeRequiredDescription
environmentstringEnvironment name, as list_environments returns. Defaults to the first (the development environment).
idstringyesReport id: the document's id, lower-case letters, digits and hyphens.

run_tests ​

Runs the report's embedded tests (spec §20: inputs plus expect expressions over the rendered result) on the draft, or the published copy with draft false, and the engine compares page snapshots with the approved ones. Returns each test's pass or fail, why it failed (expectations, render diagnostics, snapshots that are new or changed). Use it after edits to check the report still does what its tests say. Approving snapshots is for people, in the designer.

Read-only, safe to repeat.

ArgumentTypeRequiredDescription
draftbooleanRead the draft (true, the default) or the published copy (false). Without a draft, the published copy is used.
environmentstringEnvironment name, as list_environments returns. Defaults to the first (the development environment).
idstringyesReport id: the document's id, lower-case letters, digits and hyphens.
testsarray of stringOnly these tests, by name. Omit for all of them.

preview_report ​

Lays the report out with its sample data (never live data) and returns the layout model (pages and boxes with node ids), or one page as a PNG image.

Read-only, safe to repeat.

ArgumentTypeRequiredDescription
draftbooleanRead the draft (true, the default) or the published copy (false). Without a draft, the published copy is used.
environmentstringEnvironment name, as list_environments returns. Defaults to the first (the development environment).
formatlayout, pnglayout (default) or png.
idstringyesReport id: the document's id, lower-case letters, digits and hyphens.
layoutDetailpages, boxes, textlayout: pages, boxes (default) or text.
pageintegerpng: the page to draw (default 1). At least 1.

list_data_sources ​

Lists the data source catalogue of an environment: each source's name (use it as a dataset's source, e.g. billing.bill@1), description, typed parameters (fill them with the dataset's sourceParams) and output schema. Queries and connection details are never shown.

Read-only, safe to repeat.

ArgumentTypeRequiredDescription
environmentstringEnvironment name, as list_environments returns. Defaults to the first (the development environment).

get_data_source ​

Returns one data source: its parameters, output schema and sample data (never live data or the query).

Read-only, safe to repeat.

ArgumentTypeRequiredDescription
environmentstringEnvironment name, as list_environments returns. Defaults to the first (the development environment).
namestringyesSource name, e.g. billing.bill.
versionstringA version; omit for the latest.

get_report_params ​

Returns the report's parameters as prompts: types, labels, bound values and the choices of picklists, computed from sample data.

Read-only, safe to repeat.

ArgumentTypeRequiredDescription
draftbooleanRead the draft (true, the default) or the published copy (false). Without a draft, the published copy is used.
environmentstringEnvironment name, as list_environments returns. Defaults to the first (the development environment).
idstringyesReport id: the document's id, lower-case letters, digits and hyphens.
valuesobjectValues chosen so far, for cascading picklists.

list_environments ​

Lists the environments in promotion order, e.g. dev, test, uat, prod.

Read-only, safe to repeat.

No arguments.

report_history ​

Lists the published versions of a report in one environment, newest first, with commit ids for rollback_report.

Read-only, safe to repeat.

ArgumentTypeRequiredDescription
environmentstringEnvironment name, as list_environments returns. Defaults to the first (the development environment).
idstringyesReport id: the document's id, lower-case letters, digits and hyphens.

edit_report ​

Applies RFML edit operations to the draft as one atomic batch. The batch is rejected (nothing changes) if it touches locked content you may not unlock, or adds errors. Pass the baseRevision you read with get_report; if the draft has moved on, re-read it. Use dryRun to check a batch first.

Changes things.

ArgumentTypeRequiredDescription
baseRevisionintegerThe draft revision the ops were written against. Omit to use the current one. At least 0.
dryRunbooleanCheck and report without saving.
environmentstringEnvironment name, as list_environments returns. Defaults to the first (the development environment).
idstringyesReport id: the document's id, lower-case letters, digits and hyphens.
messagestringWhat the edit does, for the edit log.
opsarray of objectyesRFML edit operations (spec §21.1), applied atomically. Each has op: insert, remove, move, set, unset, renameId, wrap, unwrap, convert, extractComponent, inlineComponent, setDocument, or for tables insertRows, removeRows, insertColumns, removeColumns, mergeCells or splitCell. get_language_reference with part "ops" gives the full schema.
ops[].opstringyesOperation name.

undo_edit ​

Undoes your most recent edit to the draft that isn't undone yet.

Changes things.

ArgumentTypeRequiredDescription
environmentstringEnvironment name, as list_environments returns. Defaults to the first (the development environment).
idstringyesReport id: the document's id, lower-case letters, digits and hyphens.

put_sample ​

Writes a sample data file into the draft's bundle (samples/<name>.json). Samples are what previews render with.

Changes things, safe to repeat.

ArgumentTypeRequiredDescription
dataanyyesThe JSON sample data.
environmentstringEnvironment name, as list_environments returns. Defaults to the first (the development environment).
idstringyesReport id: the document's id, lower-case letters, digits and hyphens.
pathstringyesBundle path under samples/, e.g. samples/invoice.json.

create_report ​

Creates a new report draft from an RFML document (with rfml "0.1", an id and meta.title) and optional bundle files such as samples/<name>.json and schemas/<name>.json.

Changes things.

ArgumentTypeRequiredDescription
documentobjectyesThe RFML document.
environmentstringEnvironment name, as list_environments returns. Defaults to the first (the development environment).
filesobjectBundle files keyed by path (samples/…, schemas/…), each a JSON value.
messagestringFor the edit log.

publish_report ​

Publishes the draft to its environment: resolves its libraries and data sources, validates it (any error blocks), runs its tests (failures block, by default), writes the canonical form and a lockfile, and commits. Agents may need a person's approval; the reply then says the request is pending. Use dryRun to check without publishing.

Changes things, destructive.

ArgumentTypeRequiredDescription
dryRunbooleanRun every check and report what would be published.
environmentstringEnvironment name, as list_environments returns. Defaults to the first (the development environment).
idstringyesReport id: the document's id, lower-case letters, digits and hyphens.
messagestringCommit message.

promote_report ​

Copies the published report from one environment to the next (by default the one after from), with the library releases and data source versions its lockfile pins. Refused, with each problem listed, when the next environment can't get one of them. Agents may need a person's approval.

Changes things, destructive.

ArgumentTypeRequiredDescription
fromstringSource environment; defaults to the first.
idstringyesReport id: the document's id, lower-case letters, digits and hyphens.
tostringTarget environment; defaults to the next one.

rollback_report ​

Republishes an older version (a commit from report_history) as a new version. Agents may need a person's approval.

Changes things, destructive.

ArgumentTypeRequiredDescription
commitstringyesThe commit to restore, from report_history.
environmentstringEnvironment name, as list_environments returns. Defaults to the first (the development environment).
idstringyesReport id: the document's id, lower-case letters, digits and hyphens.