Skip to main content
Glama

apply_auto_corrections

Apply auto-correction patterns from matching contexts to text, ensuring consistent formatting and syntax across conversations.

Instructions

Apply auto-correction patterns from matching contexts to text

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYesText to apply corrections to
tool_nameYesTool context to use for corrections

Implementation Reference

  • The handler for the apply_auto_corrections tool, which uses engine.getAutoCorrections to retrieve and apply corrections.
    case 'apply_auto_corrections': {
      const text = String(args?.['text'] ?? '');
      const toolName = String(args?.['tool_name'] ?? '');
      if (!text || !toolName) {
        return {
          content: [{ type: 'text', text: 'Error: text and tool_name are required' }],
        };
      }
      const corrections = engine.getAutoCorrections(toolName);
      let result = text;
      const applied: string[] = [];
      for (const c of corrections) {
        const re = new RegExp(c.pattern, 'gi');
        if (re.test(result)) {
          result = result.replace(re, c.replacement);
          applied.push(c.name);
        }
      }
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(
              { corrected_text: result, corrections_applied: applied },
              null,
              2,
            ),
          },
        ],
      };
    }
  • Registration of the apply_auto_corrections tool in the ListToolsRequestSchema.
      name: 'apply_auto_corrections',
      description: 'Apply auto-correction patterns from matching contexts to text',
      inputSchema: {
        type: 'object' as const,
        properties: {
          text: { type: 'string', description: 'Text to apply corrections to' },
          tool_name: {
            type: 'string',
            description: 'Tool context to use for corrections',
          },
        },
        required: ['text', 'tool_name'],
      },
    },
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral disclosure. It doesn't state whether this returns corrected text or modifies in-place, what happens when no patterns match, or if the operation has side effects (e.g., logging corrections).

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?

Single sentence of nine words with action-fronted structure. No redundant or filler content; every word contributes to the core function statement.

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?

Adequate for the simple 2-parameter schema with no output requirements, but gaps exist regarding the domain context. Given siblings like 'list_available_contexts' and 'store_instinct', the description should reference how to obtain valid tool_name values or explain 'auto-correction patterns'.

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?

Schema coverage is 100% with clear parameter descriptions. The tool description maps conceptually to both parameters ('contexts' → tool_name, 'text' → text) but adds no additional semantics about valid tool_name formats, example values, or constraints beyond what the schema already provides.

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 provides a clear verb ('Apply') and resource ('auto-correction patterns'), and implies the transformation scope ('to text'). While it distinguishes functionally from siblings like 'list_available_contexts' or 'get_tool_context' through its distinct action, it lacks explicit differentiation text.

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 guidance on when to use this tool versus alternatives like manual correction. No mention of prerequisites (e.g., that contexts must be defined beforehand via sibling tools) or when auto-corrections might be inappropriate.

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/doobidoo/MCP-Context-Provider'

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