Skip to main content
Glama

generate_diagram

Create Mermaid diagrams from text descriptions to visualize concepts and workflows for documentation.

Instructions

Generate a Mermaid diagram from a text description.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
descriptionYes

Implementation Reference

  • The MCP tool handler for generate_diagram, which validates brain availability, generates the Mermaid diagram via the brain module, and returns the diagram code with rendering instructions.
    async generate_diagram(args: { description: string }) { if (!brain.isEnabled()) { return { error: ERROR_MESSAGES.SMART_FEATURES_DISABLED }; } const diagram = await brain.generateDiagram(args.description); return { diagram, note: 'Copy this Mermaid code into an Outline document to render the diagram.', }; },
  • Zod schema for validating the input to the generate_diagram tool, requiring a non-empty string description.
    export const generateDiagramSchema = z.object({ description: z.string().min(1, 'Description is required'), });
  • Tool registration using createTool function, defining the name, description, and internal handler reference for generate_diagram.
    createTool( 'generate_diagram', 'Generate a Mermaid diagram from a text description.', 'generate_diagram' ),
  • Core logic in the Brain class that checks if features are enabled and delegates diagram generation to the processor's generateMermaid method.
    async generateDiagram(description: string): Promise<string> { this.checkEnabled(); return this.processor.generateMermaid(description); }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/huiseo/outline-smart-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server