Skip to main content
Glama

diagram_from_inventory

Generates architecture diagrams directly from your live Google Cloud inventory, using real resource names and configuration-derived edges. Filters by project, region, or label to document what is actually running.

Instructions

Diagram infrastructure that is already running, from the cloud's own inventory, with real names.

Google Cloud: pass the output of gcloud asset list --project <id> --content-type resource --format json (or gcloud asset export newline-delimited JSON) in inventory_json, or a file path inside the configured input roots. Works however the resources were created (console, gcloud, IaC).

Layout: Project > VPC > Subnet > GKE cluster > namespace. Edges come from configuration (Cloud SQL/secret/Pub/Sub references, URLs matched to Cloud Run services, load balancer backends, push subscriptions, Scheduler targets, VPC connectors). Filter with projects, regions and labels (e.g. {"app": "payments"}); include_neighbors keeps resources that matched resources connect to. Calls made only in application code are not visible: add those edges to the returned spec and re-render with generate_architecture_diagram.

Input Schema

NameRequiredDescriptionDefault
pathNo
titleYes
labelsNo
regionsNo
projectsNo
providerNogcp
directionNoLR
inventory_jsonNo
output_formatsNo
render_diagramNo
include_neighborsNo
include_kubernetesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.0

TDQS

A3.7/5.0
Behavior3/5

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

Annotations declare readOnlyHint=false and openWorldHint=false, so the agent knows this is a side-effecting but self-contained operation; the description adds real value by disclosing what edges are derived from and what is invisible (application-code-only calls). However it omits where rendered files land, what happens when render_diagram is false, and whether inputs are mutated, which are non-obvious side effects for a tool flagged as not read-only.

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

Conciseness4/5

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

Front-loads the one-line purpose, then input acquisition, then layout/edge derivation, then filtering and the known limitation, so an agent can stop reading early. The embedded shell command and layout hierarchy string add density but each earns its place as actionable input prep.

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

Completeness3/5

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

Covers input sourcing, topology hierarchy, edge inference, filtering, and the follow-up workflow, which is a lot for a 12-parameter tool with no output schema. Still missing: where output artifacts are written, default output format behavior, and what the returned spec looks like when rendering is skipped, which an agent needs to chain correctly into generate_architecture_diagram.

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

Parameters4/5

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

Schema description coverage is 0%, so the description carries the full burden and does substantial work: it explains inventory_json vs path, the projects/regions/labels filters with a concrete labels example, and include_neighbors behavior. Five parameters (provider, direction, output_formats, render_diagram, include_kubernetes, title) are left entirely to their self-explanatory names, which is a modest but real gap.

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?

States a specific verb (diagram), a specific resource (already-running infrastructure), and the source of truth (the cloud's own inventory with real names), which separates it conceptually from the Terraform-based sibling. It never names diagram_from_terraform explicitly, so the agent must infer the boundary between the two, which keeps it short of a 5.

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

Usage Guidelines4/5

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

Gives concrete input instructions (the exact gcloud asset list/export command, or a file path within configured input roots) and explains the filter semantics plus include_neighbors. It also routes the agent forward with 'add those edges to the returned spec and re-render with generate_architecture_diagram' when app-code-only calls are missing, though it never states when to prefer diagram_from_terraform instead.

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