Skip to main content
Glama

mark_mistake

Record writing errors like logical fallacies or unclear passages to track and correct them in manuscripts, improving writing quality through systematic error documentation.

Instructions

Record a writing mistake to avoid repeating it

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_pathNoPath to manuscript directory (defaults to current directory)
file_pathYesFile where mistake occurred
line_rangeNoLine range (e.g., '45-52')
mistake_typeYesType of mistake
descriptionYesDescription of the mistake
correctionNoHow it should be corrected

Implementation Reference

  • The primary handler function for the 'mark_mistake' MCP tool. It parses the input arguments and delegates the call to WritersAid.markMistake.
    private async markMistake(args: Record<string, unknown>) {
      const filePath = args.file_path as string;
      const lineRange = args.line_range as string | undefined;
      const mistakeType = args.mistake_type as
        | "logical_fallacy"
        | "factual_error"
        | "poor_structure"
        | "inconsistency"
        | "unclear_writing"
        | "citation_error"
        | "redundancy"
        | "other";
      const description = args.description as string;
      const correction = args.correction as string | undefined;
    
      return this.writersAid.markMistake({
        filePath,
        lineRange,
        mistakeType,
        description,
        correction,
      });
    }
  • The dispatch case in handleTool that routes calls to the markMistake handler.
    case "mark_mistake":
      return this.markMistake(args);
  • The input schema definition for the 'mark_mistake' tool, including parameters and validation rules.
    {
      name: "mark_mistake",
      description: "Record a writing mistake to avoid repeating it",
      inputSchema: {
        type: "object",
        properties: {
          project_path: { type: "string", description: "Path to manuscript directory (defaults to current directory)" },
          file_path: { type: "string", description: "File where mistake occurred" },
          line_range: { type: "string", description: "Line range (e.g., '45-52')" },
          mistake_type: {
            type: "string",
            enum: ["logical_fallacy", "factual_error", "poor_structure", "inconsistency", "unclear_writing", "citation_error", "redundancy", "other"],
            description: "Type of mistake",
          },
          description: { type: "string", description: "Description of the mistake" },
          correction: { type: "string", description: "How it should be corrected" },
        },
        required: ["file_path", "mistake_type", "description"],
      },
    },
  • Intermediate helper in WritersAid that calls MistakeTracker.markMistake and formats the response.
    markMistake(options: {
      filePath: string;
      lineRange?: string;
      mistakeType:
        | "logical_fallacy"
        | "factual_error"
        | "poor_structure"
        | "inconsistency"
        | "unclear_writing"
        | "citation_error"
        | "redundancy"
        | "other";
      description: string;
      correction?: string;
    }) {
      const mistake = this.mistakeTracker.markMistake({
        filePath: options.filePath,
        lineRange: options.lineRange,
        mistakeType: options.mistakeType,
        description: options.description,
        correction: options.correction,
        timestamp: Date.now(),
      });
    
      return {
        id: mistake.id,
        filePath: mistake.filePath,
        mistakeType: mistake.mistakeType,
        description: mistake.description,
        timestamp: new Date(mistake.timestamp).toISOString(),
      };
    }
  • Core implementation that persists the mistake to the SQLite database.
    markMistake(mistake: Omit<WritingMistake, "id" | "createdAt">): WritingMistake {
      const now = Date.now();
      const newMistake: WritingMistake = {
        id: nanoid(),
        ...mistake,
        createdAt: now,
      };
    
      this.db
        .prepare(
          `INSERT INTO writing_mistakes
           (id, session_id, file_path, line_range, mistake_type, description, correction, how_fixed, timestamp, created_at)
           VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`
        )
        .run(
          newMistake.id,
          newMistake.sessionId || null,
          newMistake.filePath,
          newMistake.lineRange || null,
          newMistake.mistakeType,
          newMistake.description,
          newMistake.correction || null,
          newMistake.howFixed || null,
          newMistake.timestamp,
          newMistake.createdAt
        );
    
      return newMistake;
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. While 'Record' implies a write operation, the description doesn't specify where mistakes are stored, whether they're permanent or temporary, if they're visible to other users, or what happens when the same mistake is recorded multiple times. For a mutation tool with zero annotation coverage, this is a significant gap in behavioral context.

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, clear sentence that efficiently communicates the core purpose without any wasted words. It's appropriately sized for a tool with this level of complexity and gets straight to the point with zero unnecessary elaboration.

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?

For a mutation tool with no annotations and no output schema, the description is insufficiently complete. It doesn't explain what happens after recording a mistake - whether there's confirmation, where the data is stored, how it can be retrieved, or what the tool returns. With 6 parameters and a write operation, more context about the tool's behavior and outcomes is needed for effective agent use.

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 all parameters are well-documented in the schema itself. The description doesn't add any meaningful parameter semantics beyond what's already in the schema - it doesn't explain relationships between parameters, provide examples of valid inputs, or clarify edge cases. With complete schema coverage, the baseline 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 clearly states the tool's purpose with a specific verb ('Record') and resource ('writing mistake'), making it immediately understandable. However, it doesn't differentiate this tool from potential sibling tools like 'track_changes' or 'list_writing_decisions' that might also involve recording or tracking writing-related information.

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. With many sibling tools available for writing analysis and tracking, there's no indication of when 'mark_mistake' is appropriate versus tools like 'track_changes', 'find_duplicates', or 'check_before_edit'. The description simply states what it does without context for 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