Skip to main content
Glama

analyze_codebase

Build a code graph and gain project-wide insights: file counts, language distribution, complexity, and architecture. Run first to enable further analysis.

Instructions

šŸ” Perform comprehensive codebase analysis with metrics and structure overview.

šŸŽÆ PURPOSE: Builds the foundational code graph and provides project-wide insights including file counts, language distribution, complexity metrics, and architectural overview. šŸ”§ USAGE: Run this FIRST before using other analysis tools - it builds the code graph that powers all subsequent operations. ⚔ PERFORMANCE: Expensive operation (10-60s for large codebases) - results are cached for subsequent tool calls. Progress is shown during analysis. šŸ”„ WORKFLOW: analyze_codebase → specific analysis tools (find_definition, complexity_analysis, etc.) → insights and recommendations. šŸ’” TIP: Use rebuild_graph=true only if code has changed significantly since last analysis.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rebuild_graphNoForce rebuild of code graph (use only if code has changed significantly)
Behavior4/5

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

With no annotations provided, the description carries the full burden. It discloses that the operation is expensive (10-60s), that results are cached, and that progress is shown. It explains that it builds the code graph that powers subsequent operations. However, it does not explicitly clarify whether the tool modifies the filesystem or is purely read-only, though this is implied by 'analysis.' This is adequate but not exhaustive.

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?

The description is structured with labeled sections (PURPOSE, USAGE, PERFORMANCE, WORKFLOW, TIP) and each section adds value. While it includes decorative emojis, they do not dilute the content. The length is appropriate for a tool of this complexity, though it could be slightly tighter without losing clarity.

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 description provides a complete picture for invocation: it explains what the tool does, when to run it, performance characteristics, caching behavior, and the workflow to follow. It even lists the types of outputs (metrics, structure overview). With no output schema, this describes return content sufficiently. It does not mention potential failure cases or permissions, but for a read-only analysis tool, this level of context is adequate.

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 schema already fully documents the single parameter (rebuild_graph with description), achieving 100% coverage. The tool description adds extra context by providing a condition for use: 'Use rebuild_graph=true only if code has changed significantly since last analysis.' This goes beyond the schema baseline, adding meaningful guidance for parameter selection.

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 purpose: 'Perform comprehensive codebase analysis with metrics and structure overview.' It specifies concrete outputs (file counts, language distribution, complexity metrics, architectural overview) and differentiates itself from sibling analysis tools by explicitly positioning itself as the foundational first step that builds the code graph.

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?

The description gives explicit usage guidance: 'Run this FIRST before using other analysis tools' and shows the workflow (analyze_codebase → specific analysis tools). It also advises when to use the rebuild_graph parameter ('only if code has changed significantly'), which provides clear context for when to use this tool versus alternatives.

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/entrepeneur4lyf/code-graph-mcp'

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