render_diagram
Render a mingrammer/diagrams Python snippet to PNG and return the image.
The code must be a complete Python script using `from diagrams import ...` imports
and a `with Diagram(...)` context manager block.
Use search_nodes to verify node names and get correct import paths before writing code.
Read the diagrams://reference/diagram, diagrams://reference/edge, and
diagrams://reference/cluster resources for constructor options and usage examples.
Args:
code: Full Python code using the diagrams library.
filename: Output filename without extension.
format: Output format — ``"png"`` (default), ``"svg"``, or ``"pdf"``.
download_link: If True, store the image on the server and return a
temporary download URL path (/images/{token}) instead of
the inline image. The link expires after 15 minutes.
list_providers
List all available diagram providers (aws, gcp, azure, k8s, onprem, etc.).
Use list_providers -> list_services -> list_nodes to browse available node types
for a specific provider.
list_services
List service categories for a provider (e.g. 'aws' -> ['compute', 'database', ...]).
Args:
provider: Provider name from list_providers (e.g. 'aws', 'gcp', 'k8s').
list_nodes
List available node classes for a provider.service combo.
Args:
provider: Provider name (e.g. 'aws', 'gcp', 'k8s').
service: Service category (e.g. 'compute', 'database', 'network').
Returns:
List of nodes with keys: name, import, alias_of (optional).
search_nodes
Search for diagram nodes by keyword across all providers and services.
For targeted browsing when you know the provider, use list_providers -> list_services ->
list_nodes instead.
Args:
query: Search term (case-insensitive substring match).
Returns:
List of matching nodes with keys: node, provider, service, import, alias_of (optional).
Sorted by relevance: exact match first, then prefix, then substring.
render_mermaid
Render a Mermaid diagram definition and return the image with metadata.
The definition should be valid Mermaid syntax (e.g. flowchart, sequence,
class, ER, state, or Gantt diagram).
Returns a list of content blocks: the rendered image plus a JSON text
block with metadata including a mermaid.live edit link for opening the
diagram in a browser editor.
Args:
definition: Mermaid diagram definition text.
filename: Output filename without extension.
format: Output format — ``"png"`` (default), ``"svg"``, or ``"pdf"``.
download_link: If True, store the image on the server and return a
temporary download URL path (/images/{token}) instead of
the inline image. The link expires after 15 minutes.