Skip to main content
Glama

infer_architecture

Scans a repository to infer its architectural pattern and entry points, then saves the hypothesis to reforge-state.json as an initial project map.

Instructions

Infer a repository's architectural pattern and save its hypothesis to reforge-state.json. Use when: you need an initial map of the project's likely shape and entry points. Don't use when: you only need the previously saved hypothesis (use read_memory instead).

Returns {pattern, evidence, entry_points, inferred_modules, confidence, hypothesis}. Pattern is REST API, CLI tool, web frontend, library or unknown; confidence is a heuristic fraction from 0 to 1. Classification uses imported modules, with filename-based entry-point/module guesses. Scans without an external model, then writes architecture_hypothesis and rotates state backups.

Input Schema

NameRequiredDescriptionDefault
repo_pathYesRepository directory to scan and save architecture_hypothesis in reforge-state.json; prefer an absolute path. Existing state backups rotate.

Output Schema

NameRequiredDescriptionDefault
patternYes
evidenceYes
confidenceYes
hypothesisYes
entry_pointsYes
inferred_modulesYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.4.5
    • addedInput schema / properties / repo_path / description
      Added value: +"Repository directory to scan and save architecture_hypothesis in reforge-state.json; prefer an absolute path. Existing state backups rotate."
    • removedOutput schema / additionalProperties
      Removed value: -true
    • addedOutput schema / properties
      Added value: +{
      +  "confidence": {
      +    "type": "number"
      +  },
      +  "entry_points": {
      +    "items": {
      +      "type": "string"
      +    },
      +    "type": "array"
      +  },
      +  "evidence": {
      +    "items": {
      +      "type": "string"
      +    },
      +    "type": "array"
      +  },
      +  "hypothesis": {
      +    "type": "string"
      +  },
      +  "inferred_modules": {
      +    "items": {
      +      "type": "string"
      +    },
      +    "type": "array"
      +  },
      +  "pattern": {
      +    "type": "string"
      +  }
      +}
    • addedOutput schema / required
      Added value: +[
      +  "pattern",
      +  "evidence",
      +  "entry_points",
      +  "inferred_modules",
      +  "confidence",
      +  "hypothesis"
      +]
  2. Addedv0.2.9

TDQS

A4.6/5.0
Behavior5/5

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

Annotations declare readOnlyHint=false and destructiveHint=false but say nothing about what actually gets written. The description fills that gap: it writes architecture_hypothesis into reforge-state.json, rotates existing state backups, and scans without an external model using imported modules plus filename-based heuristics. It also discloses the heuristic nature of confidence, which sets correct expectations about the output.

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, then use/don't-use, then behavior and return shape — a clean progression with no filler. The return-value enumeration is slightly redundant since an output schema exists, which keeps it from a 5.

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 single-parameter, non-open-world scan-and-write tool, the description covers the trigger condition, the alternative, the mutation of state with backup rotation, the classification method, and confidence semantics. Nothing an agent needs in order to call it correctly or interpret results is missing.

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 coverage is 100% and the single repo_path parameter is fully documented in the schema, including the absolute-path preference and backup rotation note. The description adds no parameter-level meaning beyond that, so the 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?

States a specific verb and resource ("Infer a repository's architectural pattern") plus the persistence side effect, and explicitly distinguishes itself from read_memory as the read-only alternative for the saved hypothesis. An agent can separate this from scan_repo or read_memory 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 "Use when" (need an initial map of likely shape and entry points) and "Don't use when" (only need the previously saved hypothesis → use read_memory instead), naming the sibling to route to. No inference required from the agent.

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