Skip to main content
Glama

find_gaps

Identifies terms mentioned but not explained in manuscript markdown files to improve clarity and completeness for readers.

Instructions

Find terms mentioned but not explained

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_pathNoPath to manuscript directory (defaults to current directory)
scopeNoFile scope pattern
limitNoMaximum results

Implementation Reference

  • Primary tool handler that processes MCP args, applies pagination, and delegates to WritersAid service.
    private async findGaps(args: Record<string, unknown>) {
      const scope = args.scope as string | undefined;
      const limit = resolvePaginationLimit("find_gaps", args.limit as number | undefined);
    
      return this.writersAid.findGaps({ scope, limit });
    }
  • MCP tool schema definition including input validation.
    {
      name: "find_gaps",
      description: "Find terms mentioned but not explained",
      inputSchema: {
        type: "object",
        properties: {
          project_path: { type: "string", description: "Path to manuscript directory (defaults to current directory)" },
          scope: { type: "string", description: "File scope pattern" },
          limit: { type: "number", description: "Maximum results", default: 20 },
        },
      },
    },
  • Core implementation executing the gap-finding logic: extracts terms and definitions from files, identifies undefined terms with multiple mentions.
    async findGaps(options: { scope?: string; limit?: number }): Promise<TermGap[]> {
      const { limit } = options;
      const files = await this.storage.getAllFiles();
      const termMentions = new Map<string, { count: number; files: Set<string> }>();
      const definedTerms = new Set<string>();
    
      // Extract terms and definitions
      for (const file of files) {
        const content = file.content;
    
        // Find potential technical terms (capitalized, or specific patterns)
        const terms = this.extractTerms(content);
        for (const term of terms) {
          if (!termMentions.has(term)) {
            termMentions.set(term, { count: 0, files: new Set() });
          }
          const entry = termMentions.get(term);
          if (entry) {
            entry.count++;
            entry.files.add(file.file_path);
          }
        }
    
        // Find definitions
        const definitions = this.extractDefinitions(content);
        definitions.forEach((d) => definedTerms.add(d));
      }
    
      // Find gaps (mentioned but not defined)
      const gaps: TermGap[] = [];
    
      for (const [term, data] of termMentions) {
        if (data.count >= 2 && !definedTerms.has(term)) {
          gaps.push({
            term,
            mentions: data.count,
            files: Array.from(data.files),
            hasDefinition: false,
          });
        }
      }
    
      const sorted = gaps.sort((a, b) => b.mentions - a.mentions);
      return paginateResults(sorted, limit);
    }
  • Service layer wrapper delegating to GapFinder implementation.
    async findGaps(options?: { scope?: string; limit?: number }) {
      return this.gapFinder.findGaps(options || {});
    }
  • Tool dispatch registration in the central handleTool switch statement.
    case "find_gaps":
      return this.findGaps(args);
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. It states the tool 'finds' terms, implying a read-only operation, but doesn't disclose any behavioral traits such as performance characteristics (e.g., speed, resource usage), output format, or error handling. For a tool with no annotation coverage, this is a significant gap in transparency.

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 a single, efficient sentence ('Find terms mentioned but not explained') that is front-loaded and wastes no words. It directly conveys the core purpose without unnecessary elaboration, making it highly concise and well-structured for quick understanding.

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?

Given the complexity (a tool with 3 parameters and no output schema) and lack of annotations, the description is incomplete. It doesn't explain what the tool returns (e.g., a list of terms, locations, suggestions), how results are formatted, or any limitations (e.g., only works with certain file types). For a tool that likely outputs non-trivial results, this leaves significant gaps for an AI agent to use it effectively.

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?

The schema description coverage is 100%, so the schema already documents all three parameters (project_path, scope, limit) with descriptions. The tool description adds no additional meaning beyond what the schema provides, such as how 'scope' relates to 'terms' or what constitutes a 'gap'. With high schema coverage, the baseline score of 3 is appropriate.

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 'Find terms mentioned but not explained' clearly states the tool's function with a specific verb ('find') and resource ('terms mentioned but not explained'). It distinguishes itself from siblings like 'check_terminology' or 'track_concept_evolution' by focusing on unexplained terms rather than terminology validation or evolution tracking. However, it doesn't specify the context (e.g., in a manuscript) beyond what the parameters imply.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'check_terminology' (which might validate defined terms) or 'track_concept_evolution' (which might track term usage over time), nor does it specify prerequisites or exclusions. Usage is implied only through the tool name and description.

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/xiaolai/claude-writers-aid-mcp'

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