generate_document
Asks a project for a business requirements document or a software requirements specification as the token's holder, with a title, a file format and a scope, and answers with the document while it renders in the background.
Ask for a document the way the Generate menu does. project_id and kind (brd or srs; the other kinds are refused until their modules land) are required; title is the kind's name by default (3 to 160 characters), format is pdf by default or html, baseline_id names a frozen baseline of the project so the document prints exactly what the client signed (omit it for the record as it stands), drafts true prints records still in draft beside the approved ones, and summary is the opening page as plain text up to 6,000 characters; omit it and Heimdall drafts the page when the render runs, which spends the team's AI budget, so send the words when the person already has them. The document is written as rendering, numbered within its kind, and announced with document.created; the render runs on the queue as the token's holder, reading the record under their own permissions, and ends in document.rendered or document.failed. Read it back with get_document once its status is draft; a person reviews the draft, edits the opening page, and puts it to the project manager, which an agent never does for them. Runs the same action as Generate in the application.
Requires ability
The token behind the MCP session must hold it, or the call is refused with TOKEN_MISSING_ABILITY.
Annotations
A client that honours annotations asks a person before running it.
Arguments
project_id*stringUUID of the project.
kind*stringWhat to generate: brd or srs.
brdsrstitlestringoptionalThe title on the cover, 3 to 160 characters; the kind's name by default.
formatstringoptionalThe file to render: pdf by default, or html.
pdfhtmlbaseline_idstringoptionalUUID of a frozen baseline to read from; omit for the record as it stands.
draftsbooleanoptionalTrue to print records still in draft beside the approved ones.
summarystringoptionalThe opening prose, plain text up to 6,000 characters; omit it and Heimdall drafts it.
What it returns
{ "data": { "id": "d4e5f6a7-b8c9-4d0e-8f1a-2b3c4d5e6f70", "project_id": "7f3d1c92-8b45-4e6a-9d21-5c8e0a4b6f13", "kind": "brd", "reference": "BRD #3", "number": 3, "title": "BRD for the client workshop", "format": "pdf", "status": "rendering", "editable": false, "readable": false, "scope": { "baseline_id": "6a7b8c9d-0e1f-4a2b-8c3d-4e5f6a7b8c9d", "drafts": false }, "summary": "", "size": null, "checksum": null, "version": 0, "approved_at": null, "approved_revision_id": null, "rendered_by": "3f8a1c2e-7b4d-4e5f-9a6b-1c2d3e4f5a6b", "renderer_name": "Bea Analyst", "rendered_at": null, "finalised_at": null, "superseded_by_id": null, "render_failure": null, "download_url": null, "created_at": "2026-11-05T09:00:00+00:00", "updated_at": "2026-11-05T09:00:00+00:00" }}How it fails
VALIDATION_FAILEDa kind or a format that is not open yet, a title outside 3 to 160 characters, a summary over 6,000 characters, a baseline_id that is not a UUID, or a baseline of the project that is still a draft.
RESOURCE_NOT_FOUNDunknown project_id, a project outside the token's scope, or a baseline_id that is unknown or another project's; nothing is written.
FORBIDDENthe token is a client guest's, or the holder's role on the project does not carry document:create.
TOKEN_MISSING_ABILITYtoken lacks document:create.
Related
How is this guide?
Last updated on