Skip to main content
Glama

search_similar_mistakes

Identify and avoid repeating writing errors by searching for similar mistakes in your manuscript to improve document quality.

Instructions

Search for similar mistakes to avoid repeating them

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_pathNoPath to manuscript directory (defaults to current directory)
descriptionYesDescription to search for similar mistakes
limitNoMaximum results

Implementation Reference

  • Tool handler that parses input arguments and delegates execution to WritersAid.searchSimilarMistakes
    private async searchSimilarMistakes(args: Record<string, unknown>) {
      const description = args.description as string;
      const limit = (args.limit as number) || 5;
    
      return this.writersAid.searchSimilarMistakes({ description, limit });
    }
  • Input schema definition for the MCP tool, specifying parameters like description and optional limit
    {
      name: "search_similar_mistakes",
      description: "Search for similar mistakes to avoid repeating them",
      inputSchema: {
        type: "object",
        properties: {
          project_path: { type: "string", description: "Path to manuscript directory (defaults to current directory)" },
          description: { type: "string", description: "Description to search for similar mistakes" },
          limit: { type: "number", description: "Maximum results", default: 5 },
        },
        required: ["description"],
      },
    },
  • Registration of the tool handler in the main switch dispatcher within handleTool method
    case "search_similar_mistakes":
      return this.searchSimilarMistakes(args);
  • Core helper function implementing similarity search via keyword extraction and SQL LIKE queries on the mistakes database
    searchSimilarMistakes(
      description: string,
      limit = 5
    ): WritingMistake[] {
      const keywords = description
        .toLowerCase()
        .split(/\s+/)
        .filter((w) => w.length > 3);
    
      if (keywords.length === 0) {
        return [];
      }
    
      // Use LIKE for basic text matching
      let sql = `SELECT id, session_id, file_path, line_range, mistake_type, description, correction, how_fixed, timestamp, created_at
                 FROM writing_mistakes
                 WHERE `;
    
      const conditions = keywords.map(() => `LOWER(description) LIKE ?`);
      sql += conditions.join(" OR ");
      sql += ` ORDER BY timestamp DESC LIMIT ?`;
    
      const params: unknown[] = keywords.map((kw) => `%${kw}%`);
      params.push(limit);
    
      const rows = this.db.prepare(sql).all(...params) as MistakeRow[];
      return rows.map((row) => this.rowToMistake(row));
    }
  • Intermediate wrapper in WritersAid that invokes MistakeTracker and formats the response for the tool
    searchSimilarMistakes(options: { description: string; limit?: number }) {
      const mistakes = this.mistakeTracker.searchSimilarMistakes(
        options.description,
        options.limit || 5
      );
    
      return {
        matches: mistakes.map((m) => ({
          id: m.id,
          filePath: m.filePath,
          mistakeType: m.mistakeType,
          description: m.description,
          correction: m.correction,
          howFixed: m.howFixed,
          timestamp: new Date(m.timestamp).toISOString(),
        })),
        total: mistakes.length,
      };
    }
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 mentions 'search' but doesn't clarify what constitutes a 'mistake', how results are returned (e.g., format, ranking), or any limitations like performance or scope. This leaves significant gaps in understanding the tool's behavior.

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 that directly states the tool's purpose without any redundant words. It is appropriately sized and front-loaded, making it easy to parse quickly, which is ideal for conciseness.

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 of a search tool with no annotations and no output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., list of mistakes, error messages) or provide enough context about the search mechanism, making it inadequate for an agent to fully understand how 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, description, limit) with their types and defaults. The description adds no additional meaning beyond what the schema provides, such as explaining how the description parameter is used in the search or what 'similar' entails, resulting in a baseline 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 as searching for similar mistakes to avoid repetition, which is a specific action. However, it doesn't explicitly differentiate from sibling tools like 'find_duplicates' or 'find_concept_contradictions', which might have overlapping functionality, so it doesn't achieve full sibling distinction.

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 any prerequisites, exclusions, or specific contexts, leaving the agent to infer usage based on the tool name alone, which is insufficient for effective tool selection.

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