Skip to main content
Glama

Compile Workflow Diagram

compile_workflow

Converts supplied document evidence or raw operational text into source-referenced workflow diagrams with clean SVG, Mermaid, Excalidraw, and Studio deep links.

Instructions

Turn supplied document evidence or raw operational text into a publication-ready workflow diagram with source references, clean vector SVG, Mermaid, Excalidraw scene, and interactive Studio deep link (studioUrl). HOW TO STRUCTURE TEXT INPUTS: Either pass sources (array of 1..60 verbatim chunks {id, locator, excerpt} where each excerpt is <= 2000 chars with exact numbers/actors/thresholds preserved) OR pass raw text and Unseen will automatically segment it into source chunks. EDITING GUIDANCE: For cosmetic/styling/annotation edits, edit the returned <svg> XML directly. For structural/topological edits (adding/removing nodes or rerouting branches), edit spec (VisualSpec JSON) and call autofix_workflow ($0 deterministic connector healing + fresh SVG/Mermaid/Excalidraw) or revise_workflow.

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": {
      "schemaVersion": "<schemaVersion>",
      "userGoal": "<userGoal>",
      "sources": "<sources>"
    },
    "name": "compile_workflow"
  }
}

Input Schema

NameRequiredDescriptionDefault
textNoOptional raw document or user text. If provided when `sources` is omitted or empty, Unseen automatically segments `text` into faithful `sources[]` chunks.
jobIdNoOptional job ID when resuming a workflow after clarification
sourcesYesArray of faithful source excerpts with locators from the input document (1..60 chunks, <=2000 chars each). Preserve exact thresholds, actors, and IF/ELSE branches.
userGoalYesThe overarching operational goal or process description (e.g. 'Driver Onboarding SOP' or 'Vendor Risk Assessment')
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
hostContextNoOptional advisory context observed by the host agent
priorAnswersNoAnswers to prior Unseen clarification questions when resuming a compilation
desiredOutputNo
schemaVersionYesProtocol envelope version (must be '0.1')

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.3/5.0
Behavior3/5

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

Annotations already declare this is a non-read-only, non-idempotent, non-destructive, closed-world operation, so the safety profile is covered. The description adds real value by disclosing auto-segmentation of raw `text` and the $0 cost of autofix_workflow, but it never says whether compilation persists a job, what auth/credits it consumes (despite an `authToken` param), or how long a compile takes. Useful, but thin on mutation-side behavior for a write operation.

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

Conciseness4/5

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

Front-loaded with the outcome and the artifact list, then split into labeled HOW TO STRUCTURE and EDITING GUIDANCE blocks, so it scans well. Slightly overlong for an invocation description since the editing guidance targets post-call workflows, but each sentence carries actionable content.

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?

Compensates for the absent output schema by naming every returned artifact, which is exactly what an agent needs to plan downstream steps. With 10 parameters including nested `hostContext` and the clarification-resume fields (`jobId`, `priorAnswers`), it leaves the multi-turn clarification flow unexplained, which is the main remaining gap.

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 90% schema coverage the baseline is 3; the description earns an extra point by clarifying the `sources` vs `text` relationship, which the schema alone leaves ambiguous (sources is marked required yet text is described as an alternative). It also restates the 1..60 chunk / 2000-char limits, though it says nothing about `authToken`, `jobId`, `hostContext`, or `priorAnswers` beyond what the schema already states.

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?

States a specific verb and resource ('turn ... into a publication-ready workflow diagram') and enumerates the concrete artifacts produced (SVG, Mermaid, Excalidraw, studioUrl). It also implicitly separates itself from the sibling editors by describing what it emits versus what autofix_workflow/revise_workflow repair.

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?

Gives an explicit either/or for input construction (`sources` vs raw `text` with auto-segmentation) and names the exact alternatives for downstream edits, including the condition that selects each (cosmetic → edit SVG; structural → edit spec then autofix_workflow or revise_workflow). Nothing about routing is left to inference.

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