Skip to main content
Glama

Manage Architectural Boundary and Layer Rules

manage_architecture_rules
DestructiveIdempotent

Configure, inspect, update, reset, or delete architectural layer rules and dependency constraints in tzero.rules.json to define allowed imports and prevent cross-tier violations.

Instructions

Manages the persistent lifecycle of architectural boundary rules and tier constraints in tzero.rules.json, distinguishing from 'enforce_architecture_rules' and 'generate_architecture_blueprint' by configuring layer definitions on disk rather than evaluating codebase compliance or generating visual diagrams.

Parameters:

  • action: Rule lifecycle operation: 'query' inspects active boundary definitions; 'update' creates or overwrites rule configurations; 'delete' removes a specified rule; 'reset' restores enterprise-default 4-tier rules.

  • project_root: Directory path containing or intended to hold tzero.rules.json; defaults to current working directory.

  • rule_name: Specific rule identifier or layer name (e.g. 'presentation', 'domain', 'persistence', 'forbidden_imports') to target during 'update' or 'delete'.

  • rule_definition: Valid JSON string or Markdown specification defining layer constraints, allowed imports, or forbidden cross-tier dependencies when action is 'update'.

Behavior:

  • Mutability: State-modifying; writes and updates tzero.rules.json on disk when action is 'update', 'delete', or 'reset'; read-only when action is 'query'.

  • Idempotency: Idempotent for identical rule definitions and queries; resets restore canonical default JSON.

  • Privacy & Network: 100% offline local filesystem storage; zero cloud synchronization or external dependencies.

  • Performance & Resources: Executes in <20ms; atomic file writing prevents file corruption during concurrent operations.

  • Auth: Zero authentication or cloud credentials required.

  • Return Structure: Emits JSON or Markdown status confirmation of updated, deleted, or queried boundary configurations.

  • Error Handling: Validates JSON syntax before writing to disk; emits clear error diagnostics on malformed JSON without modifying existing rules.

Usage Guidelines:

  • When to use: Configure, inspect, update, reset, or remove architectural layer definitions and dependency constraints (e.g. preventing presentation layer from importing persistence layer).

  • When NOT to use: Do not use for validating whether existing codebase files violate these rules (use 'enforce_architecture_rules' instead); do not use for rendering Mermaid architecture diagrams (use 'generate_architecture_blueprint' instead).

Returns: JSON or Markdown status report detailing active or updated architectural rules and confirmation of modified file path.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "manage_architecture_rules"
  }
}

Input Schema

NameRequiredDescriptionDefault
actionNoRule lifecycle action: 'query' to inspect active rules, 'update' to add or modify rules, 'delete' to remove a rule, 'reset' to restore defaults.query
rule_nameNoName or identifier of the rule to update or delete when action is 'update' or 'delete'.
project_rootNoTarget repository root where tzero.rules.json is located (default: current directory)..
rule_definitionNoJSON string or markdown specification of the rule to set when action is 'update'.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv7.3.2
  2. Removedv7.0.1
  3. Addedv7.0.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true, idempotentHint=true, readOnlyHint=false and openWorldHint=false, but the description goes further by mapping read-only vs. write behavior to specific action values (query vs. update/delete/reset). It also discloses atomic file writing, JSON validation before disk writes, error behavior on malformed input, offline-only storage, and auth requirements — genuine value beyond structured fields.

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?

Well front-loaded: the opening sentence establishes purpose and sibling differentiation before the parameter list. However, the parameter block duplicates a schema that is already fully documented, and return values are described twice — under "Return Structure" in Behavior and again in a trailing "Returns" paragraph.

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 state-mutating configuration tool with four parameters, the description covers safety profile per action, idempotency, error handling, storage location, and confirmation output. Since an output schema exists, the extra return-value prose is redundant but not harmful to completeness.

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 coverage is already 100%, so the baseline is 3; the description adds modestly by giving concrete rule_name examples ('presentation', 'domain', 'persistence', 'forbidden_imports') and clarifying that 'reset' restores enterprise-default 4-tier rules. It mostly restates the schema's per-parameter descriptions, which caps it below a 5.

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?

States a specific verb and resource ("persistent lifecycle of architectural boundary rules and tier constraints in tzero.rules.json") and explicitly contrasts itself with enforce_architecture_rules and generate_architecture_blueprint. An agent can distinguish this from all relevant siblings without opening any 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" list with concrete examples (preventing presentation from importing persistence) and an explicit "When NOT to use" section naming the exact alternative tool for each excluded case. Nothing is left to inference.

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