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;
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool generates diagrams but doesn't cover important aspects like output format (e.g., image file type), permissions needed, rate limits, or whether it's a read-only or mutation operation. For a tool with 8 parameters and no annotations, this leaves significant gaps in understanding its behavior.

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

Conciseness5/5

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

The description is extremely concise and front-loaded, consisting of a single, efficient sentence: 'Generate technical diagrams, flowcharts, and architectural mockups.' Every word earns its place by clearly stating the tool's purpose without any unnecessary elaboration or redundancy.

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

Completeness2/5

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

Given the complexity (8 parameters, no output schema, no annotations), the description is insufficiently complete. It doesn't explain what the tool returns (e.g., image data, file path), how errors are handled, or any behavioral constraints. For a generative tool with multiple configuration options, more context is needed to guide effective use.

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

Parameters3/5

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

The description doesn't add any parameter-specific information beyond what's already in the input schema, which has 100% coverage with detailed descriptions for all parameters. Since the schema fully documents the parameters, the baseline score is 3. The description's general statement about diagram types doesn't provide additional semantic value for individual parameters.

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 clearly states the tool's purpose: 'Generate technical diagrams, flowcharts, and architectural mockups.' It specifies the verb 'generate' and the resource types, making it easy to understand what the tool does. However, it doesn't explicitly differentiate from sibling tools like 'generate_image' or 'generate_pattern,' which might also create visual outputs.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools or contexts where this tool is preferred, such as for structured diagrams versus general images. Without such guidance, users might struggle to choose between this and tools like 'generate_image' or 'edit_image.'

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

Install Server

Other Tools

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