Skip to main content
Glama

validate_architecture_code

Validates Dart source code against Clean Architecture layer rules and returns structured violations for read-only static analysis.

Instructions

Validate Dart source code against enterprise Clean Architecture rules for a specific layer.

Strictly READ-ONLY: Performs static analysis on the provided code string without writing files.
Zero Mock Data: Fails fast on invalid inputs or malformed layers, returning structured violations.

Args:
    dart_code: Full Dart source code to analyze.
    layer: Architecture layer ('domain', 'data', 'presentation', 'core', 'module').
    architecture_profile: Approved mode: imespro, external-structured, or external-standard.
        Omitted values retain legacy iMESPro checks. External Client conventions need manual verification.

Returns:
    Dictionary with status, valid flag, list of violations, checked rules, and unsupported checks.

Input Schema

NameRequiredDescriptionDefault
layerYes
dart_codeYes
architecture_profileNoimespro

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.3.1

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations present, the description carries the full burden and does so well: it declares the operation strictly READ-ONLY static analysis with no file writes and states it fails fast on invalid inputs and malformed layers, returning structured violations. It stops short of disclosing limits, auth requirements, or the cost of large inputs, but the safety profile is unambiguous.

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-loaded with purpose and the read-only guarantee, then Args and Returns. The Args/Returns blocks partially duplicate the schema, but they add the enum value lists that the schema lacks, so the length is largely earned.

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

Completeness4/5

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

The output schema exists, so the Returns summary is a bonus rather than a necessity. For a zero-annotation, three-parameter validator the description covers safety, input meaning, and default behavior; the only real gap is sibling differentiation, which is an agent-routing concern.

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 must supply the meaning, and it does: it enumerates the accepted layer values (domain, data, presentation, core, module) and the approved architecture_profile modes (imespro, external-structured, external-standard) plus the default behavior when omitted. It omits format expectations for dart_code (e.g., full file vs. snippet) and does not state that the External Client convention needs separate manual verification as a param caveat strong enough to change behavior.

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 (validate) plus resources (Dart source code, Clean Architecture rules) and scopes it to a layer, so the agent knows exactly what is checked. It does not, however, distinguish itself from the sibling validate_module_architecture, which sounds functionally adjacent.

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

Usage Guidelines3/5

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

Usage context is implied through the layer list and the profile note about omitted values retaining legacy iMESPro checks, but there is no explicit when-to-use statement or routing guidance versus validate_module_architecture or validate_proposal_spec. The agent must infer which validator applies.

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