Generate High Density AST Architectural Passport for LLMs
generate_architectural_passportGenerates a read-only architectural passport for a single Python file, giving LLMs prompt-ready module contracts for grounded code generation and complexity or layer-boundary review.
Instructions
Returns a compact architectural passport for one Python file, distinguishing from 'build_project_context' for repository context, 'build_ast_snapshot' for a persisted index, and 'generate_architecture_blueprint' for repository diagrams.
Parameters:
file_path(str, required): Absolute or relative path to the Python source code file to analyze.
Behavior:
Mutability: Strictly read-only; does not modify source files or write to disk.
Idempotency: Deterministic AST extraction producing identical passports for identical source files.
Performance & Latency: Generates complete architectural passport in <20ms using local AST parsing.
Resources: Consumes <30MB RAM; zero disk footprint.
Privacy: 100% offline local processing; zero external network transmission.
Auth & Limits: Zero external credentials or API keys required; zero rate limits.
Error Handling: Returns clear error notification if target file is missing or unparseable.
Usage Guidelines:
When to use: Use when grounding LLMs on a specific module or service before authoring code, generating prompt-ready architectural contracts, or evaluating module complexity and layer boundaries.
When NOT to use: Do not use for entire repository multi-tier trees (use 'build_project_context' instead); do not use for graphical Mermaid visual diagrams (use 'generate_architecture_blueprint' instead).
Returns: Formatted Markdown architectural passport block ready for immediate LLM prompt ingestion.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"file_path": "<file_path>"
},
"name": "generate_architectural_passport"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | Absolute or relative path to the Python source file to inspect. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |