Skip to main content
Glama

Render a Reply or Workflow Diagram

compile_workflow

Use for complex written procedures, exceptions and handoffs selected from long documents or authorized conversation context when source-traceable, editable workflow views help. Prefer native visualization for simple jobs it already handles; Unseen also supplies visuals when a suitable host renderer is absent or explicitly requested. No product mention or upload is required for replies. Keep disconnected workstreams separate; cross-visual stitching, whole-project memory, live dashboards and arbitrary graphs are unsupported. Pass a source-cited VisualSpec as spec for zero-credit deterministic rendering. Declare source origins (assistant/conversation/document/retrieved/tool); assistant suggestions are proposals, not document policy. Sources and arrays follow the schema; unknown fields are rejected. Bounded infographic groups are available only when the user asks for that visual organization. MCP defaults to renderFormat='mermaid'. Render that returned graph using the chatbot's own tools in the conversation; do not embed Unseen or Studio. Request 'preview' with includeSvg=true only for an explicit SVG/PNG export or fallback. A Mermaid code block alone is not a displayed diagram; disclose when host rendering is unavailable. Retain spec, sources, supporting rules and warnings; Mermaid alone is not the full evidence record. Label summaries as derived views and disclose omissions. Retain response-only artifacts; Studio and get_workflow need saved output. Relay needs_input questions with original evidence and answers before expiry. Hosted raw text/sources without spec uses generation credits and requires explicit consent; never switch modes silently.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "compile_workflow"
  }
}

Input Schema

NameRequiredDescriptionDefault
specNoFree deterministic mode. Pass a prepared VisualSpec v0.1 (`{schemaVersion:'0.1', kind:'flowchart', title, summary, sources, nodes, edges}`). Label outgoing decision edges. Unseen validates and renders it at zero credits without server AI.
textNoHosted AI mode when `spec` is omitted. Pass raw text if `sources` is omitted or empty. Unseen segments it and uses the account's generation allowance or credits.
jobIdNoExact jobId returned by needs_input. Resend the original evidence and all answers before expiresAt.
sourcesNoHosted AI mode when `spec` is omitted. Pass 1–60 verbatim excerpts with locators, up to 2,000 characters each. Preserve thresholds, actors, and branches. Uses the account's generation allowance or credits.
userGoalNoThe overarching operational goal or process description (defaults to `spec.title` or the first line of `text`/`sources` if omitted)
authTokenNoOptional session token (`utok_...`) obtained from `auth_verify_otp` or `auth_login` if not already supplied in the HTTP `Authorization: Bearer` header.
requestIdNoOptional client request correlation ID
includeSvgNoExplicitly include or omit inline SVG XML (defaults to true for 'full' and 'svg', false for 'preview'/'compact'/'mermaid').
hostContextNoOptional advisory context observed by the host agent
priorAnswersNoAnswers to prior Unseen clarification questions when resuming a compilation
renderFormatNoOptional output size control (MCP defaults to 'mermaid' for the host to render). Use 'preview' for a bounded inline PNG on the hosted service, with Mermaid and an owner-only SVG URL when available, or 'svg'/'mermaid' for a single format.
desiredOutputNo
schemaVersionNoProtocol envelope version (defaults to '0.1')
focusSourceIdsNoOptional subset of source IDs to focus on when compiling a specific subprocess or phase returned by detect_workflows.
confirmServerAiNoSet true only after the user approves hosted generation using one free generation or 10 credits. Required for hosted raw text or sources. Prepared specs use zero credits.
maxPreviewWidthNoTarget preview width bound in px for responsive preview metadata (default 1200).
evidenceCoverageNoOptional document preflight coverage report from the host agent (`pagesExamined`, `totalPages`, `textExtracted`, `tablesExtracted`, `embeddedDiagramsDetected`, `omittedMedia`, `notes`). When omitted media or uninspected diagrams are reported, Unseen flags `EVIDENCE_NOT_INSPECTED`.
maxPreviewHeightNoTarget preview height bound in px for responsive preview metadata (default 900).
includeExcalidrawNoExplicitly include or omit inline Excalidraw scene JSON (defaults to true only for 'full').

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / confirmServerAi
      Added value: +{
      +  "description": "Set true only after the user approves hosted generation using one free generation or 10 credits. Required for hosted raw text or sources. Prepared specs use zero credits.",
      +  "type": "boolean"
      +}
  2. Changed5 schema fields changed
    • changedInput schema / properties / desiredOutput / properties / orientation / description
      Previous value: -"Desired visual orientation"New value: +"Desired orientation: Mermaid emits TD for portrait or LR for landscape; choose uses existing auto-orientation. The host renderer controls final geometry."
    • changedInput schema / properties / renderFormat / description
      Previous value: -"Optional output size control (defaults to 'full'). Use 'preview' for a bounded inline PNG on the hosted service, with Mermaid and an owner-only SVG URL when available, or 'svg'/'mermaid' for a single format."New value: +"Optional output size control (MCP defaults to 'mermaid' for the host to render). Use 'preview' for a bounded inline PNG on the hosted service, with Mermaid and an owner-only SVG URL when available, or 'svg'/'mermaid' for a single format."
    • addedInput schema / properties / spec / additionalProperties
      Added value: +false
    • addedInput schema / properties / spec / properties
      Added value: +{
      +  "edges": {
      +    "items": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "from": {
      +          "minLength": 1,
      +          "type": "string"
      +        },
      +        "inferred": {
      +          "type": "boolean"
      +        },
      +        "label": {
      +          "description": "Required on every outgoing decision branch. Preserve the stated condition.",
      +          "maxLength": 80,
      +          "type": "string"
      +        },
      +        "sourceIds": {
      +          "items": {
      +            "minLength": 1,
      +            "type": "string"
      +          },
      +          "minItems": 1,
      +          "type": "array"
      +        },
      +        "to": {
      +          "minLength": 1,
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "from",
      +        "to",
      +        "sourceIds"
      +      ],
      +      "type": "object"
      +    },
      +    "maxItems": 240,
      +    "type": "array"
      +  },
      +  "kind": {
      +    "default": "flowchart",
      +    "enum": [
      +      "flowchart",
      +      "infographic"
      +    ],
      +    "type": "string"
      +  },
      +  "nodes": {
      +    "description": "At most 60 flow nodes and 60 supporting-rule nodes. Reuse stable IDs on correction.",
      +    "items": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "actor": {
      +          "maxLength": 80,
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "appliesTo": {
      +          "items": {
      +            "type": "string"
      +          },
      +          "type": "array"
      +        },
      +        "detail": {
      +          "maxLength": 500,
      +          "type": "string"
      +        },
      +        "id": {
      +          "minLength": 1,
      +          "type": "string"
      +        },
      +        "label": {
      +          "maxLength": 100,
      +          "minLength": 1,
      +          "type": "string"
      +        },
      +        "role": {
      +          "enum": [
      +            "step",
      +            "decision",
      +            "concept"
      +          ],
      +          "type": "string"
      +        },
      +        "ruleKind": {
      +          "enum": [
      +            "eligibility",
      +            "document",
      +            "deadline",
      +            "fee",
      +            "contact",
      +            "other"
      +          ],
      +          "type": "string"
      +        },
      +        "sourceIds": {
      +          "items": {
      +            "minLength": 1,
      +            "type": "string"
      +          },
      +          "minItems": 1,
      +          "type": "array"
      +        }
      +      },
      +      "required": [
      +        "id",
      +        "label",
      +        "role",
      +        "sourceIds"
      +      ],
      +      "type": "object"
      +    },
      +    "maxItems": 120,
      +    "minItems": 1,
      +    "type": "array"
      +  },
      +  "schemaVersion": {
      +    "default": "0.1",
      +    "enum": [
      +      "0.1"
      +    ],
      +    "type": "string"
      +  },
      +  "sources": {
      +    "items": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "confidence": {
      +          "enum": [
      +            "verbatim",
      +            "reviewed",
      +            "inferred"
      +          ],
      +          "type": "string"
      +        },
      +        "discourseRole": {
      +          "enum": [
      +            "procedural",
      +            "context",
      +            "boilerplate"
      +          ],
      +          "type": "string"
      +        },
      +        "discourseScore": {
      +          "maximum": 1,
      +          "minimum": 0,
      +          "type": "number"
      +        },
      +        "excerpt": {
      +          "maxLength": 2000,
      +          "type": "string"
      +        },
      +        "id": {
      +          "minLength": 1,
      +          "type": "string"
      +        },
      +        "locator": {
      +          "description": "Attribute a selected assistant reply, user statement, or actual retrieved reference.",
      +          "minLength": 1,
      +          "type": "string"
      +        },
      +        "modality": {
      +          "enum": [
      +            "text",
      +            "image",
      +            "diagram",
      +            "table"
      +          ],
      +          "type": "string"
      +        },
      +        "origin": {
      +          "description": "Declare who supplied this excerpt. Assistant proposals are not document rules; tool receipts alone establish executed outcomes. Caller attribution is not independently verified.",
      +          "enum": [
      +            "assistant",
      +            "conversation",
      +            "document",
      +            "retrieved",
      +            "tool"
      +          ],
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "id",
      +        "locator",
      +        "excerpt"
      +      ],
      +      "type": "object"
      +    },
      +    "maxItems": 60,
      +    "minItems": 1,
      +    "type": "array"
      +  },
      +  "summary": {
      +    "default": "",
      +    "maxLength": 400,
      +    "type": "string"
      +  },
      +  "title": {
      +    "maxLength": 100,
      +    "minLength": 1,
      +    "type": "string"
      +  },
      +  "warnings": {
      +    "items": {
      +      "type": "string"
      +    },
      +    "maxItems": 10,
      +    "type": "array"
      +  }
      +}
    • addedInput schema / properties / spec / required
      Added value: +[
      +  "title",
      +  "sources",
      +  "nodes",
      +  "edges"
      +]
  3. Changed4 schema fields changed
    • changedInput schema / properties / desiredOutput / properties / granularity / description
      Previous value: -"Target scope level: 'overview' for parent lifecycle summary (~8-12 steps), 'subprocess' when paired with focusSourceIds, or 'all'."New value: +"Target scope level: 'overview' for a parent lifecycle summary, 'subprocess' when paired with focusSourceIds, or 'all'."
    • changedInput schema / properties / sources / description
      Previous value: -"Array of faithful source excerpts with locators from the input document (1..60 chunks, <=2000 chars each). Preserve exact thresholds, actors, and IF/ELSE branches."New value: +"Hosted AI mode when `spec` is omitted. Pass 1–60 verbatim excerpts with locators, up to 2,000 characters each. Preserve thresholds, actors, and branches. Uses the account's generation allowance or credits."
    • changedInput schema / properties / spec / description
      Previous value: -"Optional Host-LLM pre-synthesized VisualSpec v0.1 JSON (`{schemaVersion:'0.1', kind:'flowchart', title, summary, sources, nodes, edges}`). When supplied, Unseen skips server-LLM generation ($0 credits, <50ms) and deterministically validates citations, heals connectors, and compiles SVG + Mermaid + Excalidraw + studioUrl."New value: +"Free deterministic mode. Pass a prepared VisualSpec v0.1 (`{schemaVersion:'0.1', kind:'flowchart', title, summary, sources, nodes, edges}`). Label outgoing decision edges. Unseen validates and renders it at zero credits without server AI."
    • changedInput schema / properties / text / description
      Previous value: -"Optional raw document or user text. If provided when `sources` is omitted or empty, Unseen automatically segments `text` into faithful `sources[]` chunks."New value: +"Hosted AI mode when `spec` is omitted. Pass raw text if `sources` is omitted or empty. Unseen segments it and uses the account's generation allowance or credits."
  4. Changed2 schema fields changed
    • changedInput schema / properties / jobId / description
      Previous value: -"Optional job ID when resuming a workflow after clarification"New value: +"Exact jobId returned by needs_input. Resend the original evidence and all answers before expiresAt."
    • changedInput schema / properties / renderFormat / description
      Previous value: -"Optional output size control (defaults to 'full'). Use 'preview' for compact metadata + svgUrl + mermaid without large inline Excalidraw/SVG blobs, or 'svg'/'mermaid' for a single format."New value: +"Optional output size control (defaults to 'full'). Use 'preview' for a bounded inline PNG on the hosted service, with Mermaid and an owner-only SVG URL when available, or 'svg'/'mermaid' for a single format."
  5. Changed14 schema fields changed
    • addedInput schema / properties / desiredOutput / properties / granularity
      Added value: +{
      +  "description": "Target scope level: 'overview' for parent lifecycle summary (~8-12 steps), 'subprocess' when paired with focusSourceIds, or 'all'.",
      +  "enum": [
      +    "overview",
      +    "subprocess",
      +    "all"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / evidenceCoverage
      Added value: +{
      +  "description": "Optional document preflight coverage report from the host agent (`pagesExamined`, `totalPages`, `textExtracted`, `tablesExtracted`, `embeddedDiagramsDetected`, `omittedMedia`, `notes`). When omitted media or uninspected diagrams are reported, Unseen flags `EVIDENCE_NOT_INSPECTED`.",
      +  "properties": {
      +    "embeddedDiagramsDetected": {
      +      "type": "number"
      +    },
      +    "notes": {
      +      "type": "string"
      +    },
      +    "omittedMedia": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "pagesExamined": {
      +      "type": "number"
      +    },
      +    "tablesExtracted": {
      +      "type": "boolean"
      +    },
      +    "textExtracted": {
      +      "type": "boolean"
      +    },
      +    "totalPages": {
      +      "type": "number"
      +    }
      +  },
      +  "type": "object"
      +}
    • addedInput schema / properties / focusSourceIds
      Added value: +{
      +  "description": "Optional subset of source IDs to focus on when compiling a specific subprocess or phase returned by detect_workflows.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • addedInput schema / properties / includeExcalidraw
      Added value: +{
      +  "description": "Explicitly include or omit inline Excalidraw scene JSON (defaults to true only for 'full').",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / includeSvg
      Added value: +{
      +  "description": "Explicitly include or omit inline SVG XML (defaults to true for 'full' and 'svg', false for 'preview'/'compact'/'mermaid').",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / maxPreviewHeight
      Added value: +{
      +  "description": "Target preview height bound in px for responsive preview metadata (default 900).",
      +  "type": "number"
      +}
    • addedInput schema / properties / maxPreviewWidth
      Added value: +{
      +  "description": "Target preview width bound in px for responsive preview metadata (default 1200).",
      +  "type": "number"
      +}
    • addedInput schema / properties / renderFormat
      Added value: +{
      +  "description": "Optional output size control (defaults to 'full'). Use 'preview' for compact metadata + svgUrl + mermaid without large inline Excalidraw/SVG blobs, or 'svg'/'mermaid' for a single format.",
      +  "enum": [
      +    "full",
      +    "preview",
      +    "compact",
      +    "svg",
      +    "mermaid"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / schemaVersion / description
      Previous value: -"Protocol envelope version (must be '0.1')"New value: +"Protocol envelope version (defaults to '0.1')"
    • addedInput schema / properties / sources / items / properties / confidence
      Added value: +{
      +  "description": "Optional evidence grounding confidence ('verbatim', 'reviewed', or 'inferred').",
      +  "enum": [
      +    "verbatim",
      +    "reviewed",
      +    "inferred"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / sources / items / properties / modality
      Added value: +{
      +  "description": "Optional evidence modality ('text', 'image', 'diagram', or 'table').",
      +  "enum": [
      +    "text",
      +    "image",
      +    "diagram",
      +    "table"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / spec
      Added value: +{
      +  "description": "Optional Host-LLM pre-synthesized VisualSpec v0.1 JSON (`{schemaVersion:'0.1', kind:'flowchart', title, summary, sources, nodes, edges}`). When supplied, Unseen skips server-LLM generation ($0 credits, <50ms) and deterministically validates citations, heals connectors, and compiles SVG + Mermaid + Excalidraw + studioUrl.",
      +  "type": "object"
      +}
    • changedInput schema / properties / userGoal / description
      Previous value: -"The overarching operational goal or process description (e.g. 'Driver Onboarding SOP' or 'Vendor Risk Assessment')"New value: +"The overarching operational goal or process description (defaults to `spec.title` or the first line of `text`/`sources` if omitted)"
    • removedInput schema / required
      Removed value: -[
      -  "schemaVersion",
      -  "userGoal",
      -  "sources"
      -]
  6. Changed1 schema field changed
    • addedInput schema / properties / desiredOutput / properties / swimlane
      Added value: +{
      +  "description": "Optional swimlane layout toggle (defaults to automatic swimlanes when 2+ actor groups exist)",
      +  "type": "boolean"
      +}
  7. First observed

TDQS

A4.1/5.0
Behavior5/5

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

Goes well beyond the annotations (readOnlyHint=false, destructiveHint=false), disclosing credit economics ('zero-credit deterministic rendering', hosted raw text 'uses generation credits and requires explicit consent'), validation behavior ('unknown fields are rejected'), MCP default renderFormat='mermaid', and the requirement to relay needs_input questions 'before expiry'. It also states a hard prohibition on silent mode switching and clarifies what is not persisted ('response-only artifacts; Studio and get_workflow need saved output').

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?

Nearly every sentence carries a real constraint, but the description is a single undifferentiated block of ~10 dense sentences that mixes purpose, mode selection, credit policy, rendering guidance, and evidence retention without structure. The purpose statement is not front-loaded cleanly, and several clauses (evidence record retention, labeling derived views) could be consolidated.

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

Completeness4/5

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

For a 19-parameter tool with nested objects and no output schema, the definition covers mode selection, credit/consent rules, output format options, and evidence obligations thoroughly. The gap is the actual response shape: it mentions returned Mermaid/SVG/preview URLs and warnings only in passing, so an agent still cannot predict the payload fields.

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?

With 95% schema coverage the baseline is 3, and the description adds genuine meaning: spec must be a source-cited VisualSpec, decision edges must be labeled, source origins must be declared with assistant output treated as proposals rather than document policy, includeSvg should only be set for explicit export/fallback, and infographic kind only on user request. It restates little that the schema already says, though several of the 19 parameters (requestId, maxPreviewWidth, priorAnswers) get no narrative treatment.

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

Purpose4/5

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

The description establishes a specific verb+resource: compiling a source-traceable, editable workflow diagram from long documents or authorized conversation context, with a deterministic spec path and a hosted-text path. It distinguishes itself from a host's native visualization and from saved-output consumers (Studio, get_workflow), but the core purpose is buried under dense procedural prose in the opening sentence.

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

Usage Guidelines4/5

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

Explicit when-to-use ('complex written procedures, exceptions and handoffs... when source-traceable, editable workflow views help') and explicit when-not ('Prefer native visualization for simple jobs it already handles') plus a list of unsupported scenarios (cross-visual stitching, whole-project memory, live dashboards, arbitrary graphs). It also routes the two modes (spec vs text/sources) and consent, though it never names siblings like detect_workflows or enhance_workflow as alternatives even where relevant.

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.