Skip to main content
Glama

check_architecture

Evaluates custom layering rules (forbid/allowOnly) against the semantic type dependency graph of a .NET solution, catching violations from resolved symbols across namespaces or projects.

Instructions

Check user-supplied layering rules against the solution's real semantic type graph (resolved symbols, not using directives — so a fully qualified reference with no using is still caught, and an unused using is not reported). Rule kinds: forbid (a dependency from from to to is a violation) and allowOnly (a dependency from from to anything outside to is a violation). TWO SEMANTICS YOU MUST KNOW TO READ AN EMPTY RESULT CORRECTLY. (1) allowOnly evaluates ONLY solution-internal, non-generated targets: references to framework and NuGet namespaces such as System.Collections.Generic are ignored (otherwise every file would violate every allowOnly rule), and so are types declared entirely in generated code, which the caller cannot remove. To restrict a framework or generated namespace, write an explicit forbid — that path DOES evaluate metadata and generated targets. (2) Self-references are always allowed: a scope depending on itself is never a violation, under either kind. Results are grouped per violated rule plus sourceScope plus targetScope edge, each with a full referenceCount and the first maxSitesPerViolation sites. Sorted by rule order, then by descending reference count. Generated code is never reported as the SOURCE of a violation under either kind. Envelope adds a byRule / totalReferences / rulesEvaluated summary.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of items to return (default: 100). Items are sorted by rule order, then by descending reference count.
rulesYesLayering rules to evaluate, in priority order. Each is `kind` (`forbid` or `allowOnly`), `from`, `to` (array of patterns), and an optional `description`.
scopeNoScope compared by the rules: `namespace` (default) or `project`.namespace
maxSitesPerViolationNoMaximum example sites recorded per violated edge (default: 5). The full reference count is reported regardless.
Behavior5/5

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

With no annotations, the description fully discloses behavior: 'allowOnly' ignores framework/generated targets, self-references allowed, generated code never a source, etc. No contradictions.

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

Conciseness3/5

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

Information-dense but verbose; could benefit from bullet points or tighter structure. Every sentence adds value, but readability suffers.

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?

Comprehensive: covers rule syntax, two semantics, result grouping, sorting, and output structure (envelope with byRule). No output schema, so the description compensates fully.

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 has 100% coverage, but the description adds valuable nuance beyond schema, e.g., explaining 'to' arrays for forbid vs. allowOnly and the priority order of rules.

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 description clearly states the tool checks user-supplied layering rules against the solution's semantic type graph. It distinguishes from siblings by focusing on custom rule evaluation, not just dependency analysis.

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?

Detailed guidance on rule kinds and interpretation of empty results. Lacks explicit when-not-to-use or alternatives, but context is sufficient for an agent to decide.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/MarcelRoozekrans/roslyn-codelens-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server