Skip to main content
Glama

generate_diagram

Create technical diagrams, flowcharts, and architectural mockups from natural language descriptions. Customize diagram type, style, layout, and detail level for clear visual documentation.

Instructions

Generate technical diagrams, flowcharts, and architectural mockups

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
promptYesDescription of the diagram content and structure
typeNoType of diagram to generateflowchart
styleNoVisual style of the diagramprofessional
layoutNoLayout orientationhierarchical
complexityNoLevel of detail in the diagramdetailed
colorsNoColor schemeaccent
annotationsNoLabel and annotation leveldetailed
previewNoAutomatically open generated images in default viewer

Implementation Reference

  • Executes the generate_diagram tool by constructing a specialized prompt and delegating to the ImageGenerator for actual image creation.
    case "generate_diagram": { const diagramRequest: ImageGenerationRequest = { prompt: this.buildDiagramPrompt(args), outputCount: 1, mode: "generate", preview: args?.preview as boolean, noPreview: (args?.noPreview as boolean) || (args?.["no-preview"] as boolean), }; response = await this.imageGenerator.generateTextToImage(diagramRequest); break; }
  • Registers the generate_diagram tool with its input schema in the list of available tools.
    { name: "generate_diagram", description: "Generate technical diagrams, flowcharts, and architectural mockups", inputSchema: { type: "object", properties: { prompt: { type: "string", description: "Description of the diagram content and structure", }, type: { type: "string", enum: [ "flowchart", "architecture", "network", "database", "wireframe", "mindmap", "sequence", ], description: "Type of diagram to generate", default: "flowchart", }, style: { type: "string", enum: ["professional", "clean", "hand-drawn", "technical"], description: "Visual style of the diagram", default: "professional", }, layout: { type: "string", enum: ["horizontal", "vertical", "hierarchical", "circular"], description: "Layout orientation", default: "hierarchical", }, complexity: { type: "string", enum: ["simple", "detailed", "comprehensive"], description: "Level of detail in the diagram", default: "detailed", }, colors: { type: "string", enum: ["mono", "accent", "categorical"], description: "Color scheme", default: "accent", }, annotations: { type: "string", enum: ["minimal", "detailed"], description: "Label and annotation level", default: "detailed", }, preview: { type: "boolean", description: "Automatically open generated images in default viewer", default: false, }, }, required: ["prompt"], }, },
  • Helper function that builds a detailed, specialized prompt string for generating diagrams based on user arguments.
    private buildDiagramPrompt(args?: DiagramPromptArgs): string { const basePrompt = args?.prompt || "system diagram"; const type = args?.type || "flowchart"; const style = args?.style || "professional"; const layout = args?.layout || "hierarchical"; const complexity = args?.complexity || "detailed"; const colors = args?.colors || "accent"; const annotations = args?.annotations || "detailed"; let prompt = `${basePrompt}, ${type} diagram, ${style} style, ${layout} layout`; prompt += `, ${complexity} level of detail, ${colors} color scheme`; prompt += `, ${annotations} annotations and labels`; prompt += ", clean technical illustration, clear visual hierarchy"; return prompt; }
  • TypeScript interface defining the shape of arguments for the diagram prompt builder, matching the tool's inputSchema.
    export interface DiagramPromptArgs { prompt?: string; type?: string; style?: string; layout?: string; complexity?: string; colors?: string; annotations?: string; }

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/Aeven-AI/mcp-nanobanana'

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