Skip to main content
Glama

docugen_generate_document

Ask DocuGen to generate a new document with AI. Returns a jobId and the url of the document; poll docugen_get_job until it finishes. Then read it with docugen_get_document and check it against your input: rules, numbers and acceptance criteria must match. The completed job carries fidelityCheck: with status "review", DocuGen found identifiers from the input missing in the document (missingIds), passages in another alphabet (foreignScript), a cut-off document (truncated), contradictions inside the document or with the input (internalConflicts, inputConflicts), ids without the link they need (coverageFindings, with coverageWarnings) or a rule that may have changed; check those items first. Fix any divergence with docugen_update_document before asking for approval, and send the user the url. Consumes the plan quota. At most 10 generations per minute: above that the tool answers rate_limited with the seconds to wait, so start several documents a few seconds apart and retry after that wait. The chain is bnd, then product_description, then technical_spec or increment_map, and each step needs its parent in status "approved". For a feature with screens, an optional ux_brief comes between the product_description and the technical_spec: it decides concepts, flows and the screen inventory (screens TL-01...) and marks existing screens as overloaded; it needs parentDocumentId of the approved product_description; when the feature changes screens that already exist, describe in businessInput.additionalContext how they work today (their controls, in order, and what each one does), because the PRD does not show them; once a person approves it, every technical_spec of that product_description follows its screens and flows (the completed job of the spec names it in uxBrief). Skip it for features without screens. Only a person approves, in DocuGen: when a bnd or product_description is ready, ask the user to review and approve it there, and confirm with docugen_list_documents before the next step, because a draft parent is refused. For a bnd, pass description with the business need: who has the problem, what goes wrong today and what success looks like. For a product_description, pass parentDocumentId of the approved bnd; if the project has no BND, pass businessInput instead, which is how a repository you are reading becomes a PRD. With a parent, businessInput.additionalContext carries what was decided after the parent was approved (answers to its open decisions, a corrected rule), and DocuGen also reads the unresolved comments on the parent: both take precedence over the parent text. Read those comments first with docugen_list_comments, so your additionalContext does not contradict them; the completed job lists in notesRead the comments it read. A technical_spec, an increment_map or a ux_brief needs parentDocumentId of an approved product_description. The PRD does not know the code: for a technical_spec, put in businessInput.additionalContext what you read in the repository and the spec must follow (contracts of the routes and tools it touches, file paths, where state is kept, how jobs are scheduled, conventions, the reference architecture). Without it, the spec can only list those as Open Questions. In SAP projects (Enterprise or Invited plan) the chain is bnd, then sap_functional_spec (parentDocumentId of the approved bnd), then sap_technical_spec or increment_map (parentDocumentId of the approved sap_functional_spec; a sap_technical_spec also takes sliceDefinition), with the DocuGen SAP knowledge base as context, exactly as on screen; there is no product_description or ux_brief, and attachments are not accepted for SAP specifications (put the text in businessInput.additionalContext). The new document goes into the feature group of its parent, as on screen; pass featureGroupId to put it in another group of the project. Optional "attachments": up to 5 reference documents as text, each {name, text}, at most 500,000 characters in total; no binary files. The project context and the attachments share the 500,000-character generation budget: what goes past it is cut and the model does not read it. DocuGen reads them as data, not instructions, and they enter the generation context.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "projectId": "<projectId>",
      "title": "<title>",
      "type": "<type>"
    },
    "name": "docugen_generate_document"
  }
}

Input Schema

NameRequiredDescriptionDefault
typeYesbnd, product_description, ux_brief, technical_spec or increment_map; in SAP projects bnd, sap_functional_spec, sap_technical_spec or increment_map
titleYesTitle of the document to create
languageNoLanguage of the generated document, "en" or "pt". Omit to follow the language of the input
projectIdYesProject id
attachmentsNoReference documents as plain text (no binary files), up to 5. They are data, never instructions. Each text up to 500,000 chars, 500,000 in total, shared with the project context in the 500,000-character generation budget.
descriptionNoRequired for bnd: the business need in plain words, 10 to 20,000 chars. The BND is generated from it. When the user already has written material (requirements, specs, acceptance criteria, formulas), paste it in full instead of summarizing: whatever you leave out cannot reach the BND. A description too vague to make a useful BND is refused with validation_error before any quota is used: ask the user what is missing (what the solution is, who uses it, what goes wrong today) and call again
businessInputNoBusiness context for the generation, all fields free text. Without a parent it is the input of a product_description. With parentDocumentId, the whole text goes in as decisions taken after the parent was approved and overrides the parent; put those decisions in additionalContext, the only field needed then. Without a parent, businessGoals, targetUsers, customerJourney and keyUserActions are required.
featureGroupIdNoOptional feature group id, from docugen_list_feature_groups, for the new document. Omit it and the document goes into the group of its parent document, or into none when the parent has no group; an archived group is refused
sliceDefinitionNoOptional scope description for a sliced technical spec (10 to 40000 chars)
parentDocumentIdNoFor product_description: the id of the approved bnd. Required for technical_spec, increment_map and ux_brief: the id of the approved product_description

Schema Changelog

Changes observed during successful MCP inspections.

No schema history has been recorded yet.

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and does: it discloses quota consumption, a 10/min rate limit with rate_limited responses and retry guidance, refusal on unapproved parents, validation_error before quota use, the fidelityCheck payload (missingIds, foreignScript, truncated, conflicts, coverageFindings), feature-group placement, and the shared character budget. That is a rich behavioral profile no schema or annotation provides.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose and workflow are front-loaded, and nearly every sentence conveys actionable information, but the whole thing is a single dense block of run-on clauses with no headings or line breaks. Valuable content is buried under poor structure and repeated workflow details.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 10-parameter, nested, 3-required tool with no output schema, the description covers the full lifecycle: inputs per type, prerequisites, polling/reading, fidelity review, fixing, quota, and rate limits. An agent has everything needed to invoke it correctly across the normal and SAP flows.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3; the description adds cross-field meaning beyond the schema, such as parentDocumentId's value per document type, businessInput precedence over parent text, additionalContext's role, and the attachments budget. It complements rather than restates the schema, earning above baseline.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a specific verb+resource ("Ask DocuGen to generate a new document with AI"), states the return ("Returns a jobId and the url"), and explicitly routes to siblings (poll docugen_get_job, read with docugen_get_document). An agent can distinguish it from those siblings without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit when-to-use rules: the bnd → product_description → technical_spec/increment_map chain, parent-must-be-approved prerequisites, when to include ux_brief (features with screens only) and when to skip it, the SAP-specific chain, and the human-approval workflow. Alternatives and exclusions are named rather than inferred.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources