Skip to main content
Glama

generate_architecture_blueprint

Read-onlyIdempotent

Generate system architecture documentation with Mermaid component diagrams, layer boundaries, and module hierarchies from codebase AST analysis, creating ARCHITECTURE.md for onboarding or RFC review.

Instructions

Generates a complete system architectural specification (ARCHITECTURE.md) with auto-generated Mermaid component topology diagrams, layer boundaries, and module hierarchies, distinguishing from 'enforce_architecture_rules' and 'analyze_code_dependencies' by producing comprehensive system architecture documentation rather than verifying boundary rules or tracing call chains.

Parameters:

  • project_root (str, optional, default='.'): Root directory of the repository to analyze (default: current directory).

  • use_ai (bool, optional, default=False): When True, uses configured AI provider to synthesize deep narrative; when False (default), runs 100% offline AST analysis.

  • model (str, optional, default=''): Optional model identifier override when use_ai is True.

Behavior:

  • Read-only: Returns formatted Markdown text without writing files to disk.

  • Idempotent: Deterministic AST topology diagram generation when use_ai=False.

  • 100% Offline by default: Runs local AST analysis; optionally uses configured AI model when use_ai=True.

  • Auth & Rate Limits: Zero credentials required for default offline mode; completes in <1s.

  • Error Handling: Falls back to offline AST structural mapping if remote AI model synthesis is unreachable.

Usage Guidelines:

  • When to use: Create or update system architecture documentation and visual Mermaid flow diagrams for onboarding or RFC review.

  • When NOT to use: Do not use for checking rule compliance against defined boundaries (use 'enforce_architecture_rules' instead); do not use for raw dependency listings or call chain traces (use 'analyze_code_dependencies' instead).

Returns: Comprehensive Markdown document with live Mermaid diagrams, layer classifications, and component interfaces.

Input Schema

NameRequiredDescriptionDefault
modelNoOptional model identifier override when use_ai is True.
use_aiNoWhen True, uses configured AI provider to synthesize deep narrative; when False (default), runs 100% offline AST analysis.
project_rootNoRoot directory of the repository to analyze (default: current directory)..

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv7.3.2
    • changedInput schema / properties / model / description
      Previous value: -"Optional model identifier override (e.g. 'deepseek-v4.1-flash', 'gpt-4o') when use_ai is True (default: '')."New value: +"Optional model identifier override when use_ai is True."
    • changedInput schema / properties / project_root / description
      Previous value: -"Repository root directory to inspect (default: '.')."New value: +"Root directory of the repository to analyze (default: current directory)."
    • changedInput schema / properties / use_ai / description
      Previous value: -"When True, supplements deterministic AST topology with local zero-cost AI architectural insights (default: False)."New value: +"When True, uses configured AI provider to synthesize deep narrative; when False (default), runs 100% offline AST analysis."
    • changedInput schema / title
      Previous value: -"_legacy_generate_architecture_blueprintArguments"New value: +"generate_architecture_blueprintArguments"
    • changedOutput schema / title
      Previous value: -"_legacy_generate_architecture_blueprintOutput"New value: +"generate_architecture_blueprintOutput"
  2. Changed3 schema fields changedv7.3.1
    • changedInput schema / properties / model / description
      Previous value: -"Optional model identifier override (e.g. 'deepseek-v4.1-flash', 'gpt-4o') when use_ai is True."New value: +"Optional model identifier override (e.g. 'deepseek-v4.1-flash', 'gpt-4o') when use_ai is True (default: '')."
    • changedInput schema / properties / project_root / description
      Previous value: -"Root directory of the repository to analyze and document (default: current directory)."New value: +"Repository root directory to inspect (default: '.')."
    • changedInput schema / properties / use_ai / description
      Previous value: -"When True, uses configured 3rd-party AI or Free AI Cloud to synthesize deep architecture analysis; when False (default), runs 100% offline AST analysis."New value: +"When True, supplements deterministic AST topology with local zero-cost AI architectural insights (default: False)."
  3. Changed5 schema fields changedv7.0.1
    • changedInput schema / properties / model / description
      Previous value: -"Optional model identifier override when use_ai is True."New value: +"Optional model identifier override (e.g. 'deepseek-v4.1-flash', 'gpt-4o') when use_ai is True."
    • changedInput schema / properties / project_root / description
      Previous value: -"Root directory of the repository to analyze (default: current directory)."New value: +"Root directory of the repository to analyze and document (default: current directory)."
    • changedInput schema / properties / use_ai / description
      Previous value: -"When True, uses configured AI provider to synthesize deep narrative; when False (default), runs 100% offline AST analysis."New value: +"When True, uses configured 3rd-party AI or Free AI Cloud to synthesize deep architecture analysis; when False (default), runs 100% offline AST analysis."
    • changedInput schema / title
      Previous value: -"generate_architecture_blueprintArguments"New value: +"_legacy_generate_architecture_blueprintArguments"
    • changedOutput schema / title
      Previous value: -"generate_architecture_blueprintOutput"New value: +"_legacy_generate_architecture_blueprintOutput"
  4. Changed3 schema fields changedv7.0.0
    • changedInput schema / properties / model / description
      Previous value: -"Optional model identifier override (e.g. 'deepseek-v4.1-flash', 'gpt-4o') when use_ai is True."New value: +"Optional model identifier override when use_ai is True."
    • changedInput schema / properties / project_root / description
      Previous value: -"Root directory of the repository to analyze and document (default: current directory)."New value: +"Root directory of the repository to analyze (default: current directory)."
    • changedInput schema / properties / use_ai / description
      Previous value: -"When True, uses configured 3rd-party AI or Free AI Cloud to synthesize deep architecture analysis; when False (default), runs 100% offline AST analysis."New value: +"When True, uses configured AI provider to synthesize deep narrative; when False (default), runs 100% offline AST analysis."
  5. Changed3 schema fields changedv0.1.1
    • addedInput schema / properties / model / description
      Added value: +"Optional model identifier override (e.g. 'deepseek-v4.1-flash', 'gpt-4o') when use_ai is True."
    • addedInput schema / properties / project_root / description
      Added value: +"Root directory of the repository to analyze and document (default: current directory)."
    • addedInput schema / properties / use_ai / description
      Added value: +"When True, uses configured 3rd-party AI or Free AI Cloud to synthesize deep architecture analysis; when False (default), runs 100% offline AST analysis."
  6. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/openWorld=false/destructive=false, but the description adds real context beyond that: it clarifies nothing is written even though it 'generates' a document, that output is deterministic offline AST analysis, that runtime is <1s with zero credentials, and that it degrades to offline AST mapping if the AI provider is unreachable. That fallback behavior is not derivable from annotations or schema and materially affects how an agent should call it.

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?

The opening sentence is strongly front-loaded and carries the disambiguation, and the behavior/usage sections are scannable. There is mild redundancy: the Parameters block duplicates the schema descriptions word-for-word, and the Returns line restates what the output schema already provides.

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

Completeness5/5

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

For a three-parameter, fully-annotated, output-schema-backed tool, nothing an agent needs is missing: what it produces, what it will not do (write files), cost/latency profile, credential requirements, failure mode, and sibling routing are all present.

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?

Schema description coverage is 100%, so all three parameters are already fully documented in the schema, and the description's parameter block largely restates those same strings verbatim. The one nuance added (offline determinism tied to use_ai=False) is behavioral rather than semantic, so baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The first sentence states a specific verb (Generates) and a concrete artifact (ARCHITECTURE.md) with its contents: Mermaid topology diagrams, layer boundaries, module hierarchies. It then explicitly contrasts with the two nearest siblings by naming what each does instead, so an agent can disambiguate without opening a schema.

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

Usage Guidelines5/5

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

Provides an explicit 'When to use' (onboarding docs, RFC review) and a 'When NOT to use' that names both alternative tools and their distinct jobs (enforce_architecture_rules for rule compliance, analyze_code_dependencies for raw dependency/call-chain data). This is textbook when/when-not/alternatives routing.

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