Skip to main content
Glama
AbdessamadTzn

FastAPI Architect MCP

build_knowledge_graph

Create or update a FastAPI knowledge graph connecting routes, handlers, schemas, models, and calls, returning its statistics. Caches changes for speed; force rebuilds from scratch.

Instructions

Build or refresh the project's FastAPI knowledge graph and return its statistics.

The graph links routes, handlers, dependencies, schemas, ORM models, SQL tables, templates and function calls. It is cached in /.fastapi-architect/ and only changed files are re-parsed, so other graph tools are fast. Use force=True to rebuild from scratch.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
forceNo
project_rootYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.3.0

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It states that the graph is cached in <project_root>/.fastapi-architect/ and that only changed files are re-parsed, which implies incremental updates and writes to the project directory. It also mentions force=True for full rebuilds. It does not detail potential side effects like overwriting existing cache or permission requirements, but it covers the key behaviors.

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

Conciseness5/5

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

The description is three sentences long, front-loaded with the core purpose, then explains graph contents, then caching and force usage. Every sentence adds necessary information without redundancy or fluff.

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?

For a build tool with no output schema, the description explains what it does (builds/refreshes), what the graph contains, caching behavior, and that it returns statistics. It does not detail the exact statistics returned or potential failure scenarios, but given the tool's role and sibling context, it is sufficiently complete.

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?

The input schema has no descriptions (0% coverage), so the description must compensate. It explicitly explains the force parameter with 'Use force=True to rebuild from scratch.' The project_root parameter is implicitly described via the cache path <project_root>/.fastapi-architect/. This adds meaning beyond the raw schema, though project_root could be more explicitly defined.

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's function: 'Build or refresh the project's FastAPI knowledge graph and return its statistics.' It specifies the verb (build/refresh), the resource (knowledge graph), and the output (statistics). It differentiates from siblings like build_dependency_graph by explicitly referring to the FastAPI knowledge graph and mentioning caching and incremental parsing, which are unique to this tool.

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?

The description provides usage context by noting that the graph is cached and only changed files are re-parsed, so other graph tools are fast after this tool runs. This implies the tool should be invoked before using other graph tools. It also explains when to use force=True ('rebuild from scratch'). It does not explicitly mention alternatives or when not to use it, but the intended usage is clear.

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