Skip to main content
Glama

Summarize Project

localnest_summarize_project
Read-onlyIdempotent

Generate a concise project summary by analyzing directory structure and files to provide high-level insights into codebase organization and content.

Instructions

Return a high-level summary of a project directory.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_pathYes
max_filesNo
response_formatNojson

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYes
metaNo

Implementation Reference

  • The core logic for summarizing a project, counting file extensions and directory structures.
    export function summarizeProject(workspace, projectPath, maxFiles) {
      const root = normalizeTarget(workspace, projectPath);
      const st = fs.statSync(root);
      if (!st.isDirectory()) {
        throw new Error('project_path is not a directory');
      }
    
      const counts = new Map();
      let totalFiles = 0;
      let totalDirs = 0;
    
      for (const { dirs, files } of walkDirectories(workspace, root)) {
        totalDirs += dirs.length;
    
        for (const filePath of files) {
          if (path.basename(filePath).startsWith('.')) continue;
          totalFiles += 1;
    
          const ext = path.extname(filePath).toLowerCase() || '<none>';
          counts.set(ext, (counts.get(ext) || 0) + 1);
    
          if (totalFiles >= maxFiles) break;
        }
    
        if (totalFiles >= maxFiles) break;
      }
    
      const topExtensions = Array.from(counts.entries())
        .sort((a, b) => b[1] - a[1])
        .slice(0, 15)
        .map(([ext, count]) => ({ ext, count }));
    
      return {
        path: root,
        directories: totalDirs,
        files_counted: totalFiles,
        top_extensions: topExtensions,
        truncated: totalFiles >= maxFiles
      };
    }
    
    export async function readFileChunk(workspace, requestedPath, startLine, endLine, maxSpan) {
      let from = startLine;
      let to = endLine;
    
      if (to < from) to = from;
      if (to - from + 1 > maxSpan) {
        to = from + maxSpan - 1;
  • The registration and entry point for the 'localnest_summarize_project' tool, which calls the service wrapper.
    registerJsonTool(
      'localnest_summarize_project',
      {
        title: 'Summarize Project',
        description: 'Return a high-level summary of a project directory.',
        inputSchema: {
          project_path: z.string(),
          max_files: z.number().int().min(100).max(20000).default(3000)
        },
        annotations: {
          readOnlyHint: true,
          destructiveHint: false,
          idempotentHint: true,
          openWorldHint: false
        }
      },
      async ({ project_path, max_files }) => normalizeProjectSummaryResult(
        workspace.summarizeProject(project_path, max_files),
Behavior3/5

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

Annotations already establish read-only, idempotent, safe operation. The description adds that it produces a 'high-level summary' versus detailed output, which provides behavioral context. However, it omits details about the max_files limit behavior or what happens with invalid paths.

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 single sentence is efficiently constructed without redundancy. However, extreme brevity becomes a liability given the lack of schema documentation and the need to distinguish this tool from 20+ siblings.

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

Completeness2/5

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

Despite having an output schema (reducing the need to describe return values), the description is incomplete due to zero parameter documentation and missing differentiation from related project-analysis tools. A tool with 3 parameters and 0% schema coverage requires richer description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description fails to compensate. While 'project directory' loosely implies the project_path parameter, it does not explain max_files (scoping limit) or response_format (output serialization), leaving three parameters effectively undocumented.

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 action (Return) and target (high-level summary of project directory). However, it does not differentiate from sibling tools like 'localnest_project_tree' or 'localnest_list_projects', leaving ambiguity about when to choose summary over structural listing.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No usage guidelines are provided. The description lacks when-to-use criteria, prerequisites (e.g., must the project be indexed first?), or guidance on choosing between this and similar analysis tools like 'localnest_project_tree' or 'localnest_search_code'.

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/wmt-mobile/localnest'

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