Skip to main content
Glama

create_flowchart

Generate flowchart diagrams with process boxes, decision diamonds, and connectors to visualize sequential workflows and decision processes.

Instructions

Create a flowchart diagram with sequential steps. Supports process boxes, decision diamonds, terminators, and connectors.

Input Schema

NameRequiredDescriptionDefault
filenameYesName for the output .drawio file (extension will be added automatically)
stepsYesArray of flowchart steps

Input Schema (JSON Schema)

{ "properties": { "filename": { "description": "Name for the output .drawio file (extension will be added automatically)", "type": "string" }, "steps": { "description": "Array of flowchart steps", "items": { "properties": { "connectorLabel": { "description": "Optional label for the connector to this step", "type": "string" }, "label": { "description": "Text label for the step", "type": "string" }, "type": { "description": "Shape type for the step", "enum": [ "process", "decision", "terminator", "data", "document", "delay" ], "type": "string" } }, "required": [ "label" ], "type": "object" }, "type": "array" } }, "required": [ "filename", "steps" ], "type": "object" }

Implementation Reference

  • index.js:68-104 (registration)
    Registration of the create_flowchart tool in the ListToolsRequestSchema handler, including name, description, and input schema.
    { name: 'create_flowchart', description: 'Create a flowchart diagram with sequential steps. Supports process boxes, decision diamonds, terminators, and connectors.', inputSchema: { type: 'object', properties: { filename: { type: 'string', description: 'Name for the output .drawio file (extension will be added automatically)', }, steps: { type: 'array', description: 'Array of flowchart steps', items: { type: 'object', properties: { label: { type: 'string', description: 'Text label for the step', }, type: { type: 'string', enum: ['process', 'decision', 'terminator', 'data', 'document', 'delay'], description: 'Shape type for the step', }, connectorLabel: { type: 'string', description: 'Optional label for the connector to this step', }, }, required: ['label'], }, }, }, required: ['filename', 'steps'], }, },
  • MCP tool handler function for create_flowchart that generates the diagram XML via the DrawioGenerator and saves it to a file.
    handleCreateFlowchart(args) { const xml = this.generator.createFlowchart(args.steps); const filePath = this.saveToFile(args.filename, xml); return { content: [ { type: 'text', text: `Flowchart diagram created successfully and saved to: ${filePath}\n\nYou can open this file directly in Draw.io.`, }, ], }; }
  • Input schema defining parameters for the create_flowchart tool: filename and array of steps with labels, types, and optional connector labels.
    inputSchema: { type: 'object', properties: { filename: { type: 'string', description: 'Name for the output .drawio file (extension will be added automatically)', }, steps: { type: 'array', description: 'Array of flowchart steps', items: { type: 'object', properties: { label: { type: 'string', description: 'Text label for the step', }, type: { type: 'string', enum: ['process', 'decision', 'terminator', 'data', 'document', 'delay'], description: 'Shape type for the step', }, connectorLabel: { type: 'string', description: 'Optional label for the connector to this step', }, }, required: ['label'], }, }, }, required: ['filename', 'steps'], },
  • Core helper function in DrawioGenerator that creates sequential flowchart shapes and connectors based on steps, then generates the Draw.io XML.
    createFlowchart(steps) { const elements = []; const spacing = 150; let currentY = 50; let previousId = null; for (let i = 0; i < steps.length; i++) { const step = steps[i]; const type = step.type || 'process'; const label = step.label || `Step ${i + 1}`; const width = step.width || 120; const height = step.height || 60; const shape = this.createShape(label, type, 300, currentY, width, height); elements.push(shape); if (previousId) { const connector = this.createConnector(previousId, shape.id, step.connectorLabel || ''); elements.push(connector); } previousId = shape.id; currentY += spacing; } return this.generateDiagram(elements); }

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/thechandanbhagat/diagram-master'

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