Skip to main content
Glama

load_project_understanding

Retrieve comprehensive project insights, including entities, relationships, patterns, and style conventions, by loading project understanding directly from the root directory, eliminating the need for individual file analysis.

Instructions

Load understanding of an entire project at once.

This tool should be used by MCP clients to quickly get project understanding if available, instead of reading all the files individually. It loads all entities, relationships, patterns, and style conventions related to the project.

Args: project_path: Path to the project root directory

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_pathYes

Implementation Reference

  • The handler function for the 'load_project_understanding' MCP tool. It is decorated with @self.mcp.tool() which registers it as an MCP tool. The function retrieves and formats a summary of the project's knowledge graph data, including entities and relations associated with the given project_path.
    @self.mcp.tool()
    def load_project_understanding(project_path: str) -> str:
        """Load understanding of an entire project at once.
    
        This tool should be used by MCP clients to quickly get project understanding
        if available, instead of reading all the files individually. It loads all
        entities, relationships, patterns, and style conventions related to the project.
    
        Args:
            project_path: Path to the project root directory
        """
        # Normalize the project path
        project_path = os.path.normpath(os.path.abspath(project_path))
    
        # Check if we have any entities related to this project
        project_entities = []
        for entity in self.knowledge.entities.values():
            entity_project = entity.metadata.get("project_path")
            if (
                entity_project
                and os.path.normpath(os.path.abspath(entity_project))
                == project_path
            ):
                project_entities.append(entity)
    
        if not project_entities:
            return f"No understanding available for project at: {project_path}"
    
        # Count entities by type
        entity_types = {}
        for entity in project_entities:
            entity_types[entity.entity_type] = (
                entity_types.get(entity.entity_type, 0) + 1
            )
    
        # Count relations
        project_entity_ids = {entity.entity_id for entity in project_entities}
        project_relations = []
        for relation in self.knowledge.relations.values():
            if (
                relation.from_id in project_entity_ids
                or relation.to_id in project_entity_ids
            ):
                project_relations.append(relation)
    
        # Format output
        output = f"Project Understanding for: {project_path}\n\n"
        output += f"Total Entities: {len(project_entities)}\n"
        output += f"Total Relations: {len(project_relations)}\n\n"
    
        if entity_types:
            output += "Entities by Type:\n"
            for entity_type, count in entity_types.items():
                output += f"- {entity_type}: {count}\n"
            output += "\n"
    
        # List key entities (e.g., modules, classes)
        key_entities = [
            e
            for e in project_entities
            if e.entity_type in ["module", "class", "interface"]
        ]
        if key_entities:
            output += "Key Components:\n"
            for entity in sorted(key_entities, key=lambda e: e.name)[
                :10
            ]:  # Limit to 10
                output += (
                    f"- {entity.name} ({entity.entity_type}): {entity.summary}\n"
                )
    
            if len(key_entities) > 10:
                output += f"... and {len(key_entities) - 10} more key components\n"
            output += "\n"
    
        # List all entities
        output += "All Entities:\n"
        for entity in sorted(project_entities, key=lambda e: e.name)[
            :30
        ]:  # Limit to 30 to avoid excessive output
            output += f"- {entity.name} ({entity.entity_type}): {entity.summary}\n"
    
        if len(project_entities) > 30:
            output += f"... and {len(project_entities) - 30} more entities\n"
        output += "\n"
    
        return output
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. While it mentions what gets loaded, it doesn't describe important behavioral aspects like whether this is a read-only operation, whether it caches results, what happens if the project is large, or what the output format looks like. For a tool with no annotations and no output schema, this leaves significant gaps in understanding how the tool behaves.

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 well-structured and appropriately sized. The first sentence states the core purpose, the second provides usage guidance, and the third elaborates on what gets loaded. The parameter documentation is separate and clear. Every sentence earns its place with no wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (loading comprehensive project understanding), no annotations, no output schema, and 0% schema description coverage, the description provides adequate but incomplete coverage. It explains what the tool does and when to use it, but lacks details about output format, performance characteristics, error conditions, and how it differs from sibling tools like 'dump_project_understanding'.

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?

With only 1 parameter and 0% schema description coverage, the description adds meaningful context by explaining what 'project_path' represents ('Path to the project root directory'). This compensates well for the lack of schema documentation. However, it doesn't provide format examples or constraints (e.g., absolute vs relative paths), preventing a perfect score.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/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: 'Load understanding of an entire project at once' and specifies what it loads ('all entities, relationships, patterns, and style conventions'). This is a specific verb+resource combination. However, it doesn't explicitly differentiate from siblings like 'dump_project_understanding' or 'get_entity_details', which prevents a perfect score.

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 clear usage context: 'This tool should be used by MCP clients to quickly get project understanding if available, instead of reading all the files individually.' This gives a strong when-to-use recommendation. However, it doesn't explicitly state when NOT to use it or name specific alternatives among the siblings, which would be needed for a score of 5.

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

Related 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/sarathsp06/sourcesage'

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