Skip to main content
Glama

m9k_errors

Read-onlyIdempotent

Find past solutions for error messages by searching indexed conversations, git repositories, and files to retrieve error context and resolution details.

Instructions

Find past solutions for an error message. Returns error context + how it was resolved.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorMessageYesThe error message or keywords from the error
limitNoMax results
sourceNoFilter by source type. Default: all sources.

Implementation Reference

  • Handler implementation for the m9k_errors tool. It uses a search function to find related past error context from the database and returns a snippet of the user query and assistant resolution.
      async ({ errorMessage, limit }) => {
        const results = await search(
          ctx.db,
          { query: errorMessage, limit: limit * 3 },
          ctx.searchContext,
        );
    
        // Enrich with error/solution extraction, filter by substantial assistant response
        const enriched: Array<{
          chunkId: string;
          sessionId: string;
          project: string;
          timestamp: string;
          error: string;
          solution: string;
          matchType: string;
        }> = [];
    
        for (const r of results) {
          const chunk = ctx.db
            .prepare('SELECT user_content, assistant_content FROM conv_chunks WHERE id = ?')
            .get(r.chunkId) as { user_content: string; assistant_content: string } | undefined;
    
          if (!chunk || chunk.assistant_content.length < 20) continue;
    
          enriched.push({
            chunkId: r.chunkId,
            sessionId: r.sessionId,
            project: r.project,
            timestamp: r.timestamp,
            error: chunk.user_content.slice(0, 200),
            solution: chunk.assistant_content.slice(0, 300),
            matchType: r.matchType,
          });
    
          if (enriched.length >= limit) break;
        }
    
        return {
          content: [{ type: 'text' as const, text: JSON.stringify(enriched) }],
        };
      },
    );
  • Registration of the m9k_errors tool within the McpServer, including its description and input schema.
    server.registerTool(
      'm9k_errors',
      {
        description:
          'Find past solutions for an error message. Returns error context + how it was resolved.',
        inputSchema: {
          errorMessage: z.string().describe('The error message or keywords from the error'),
          limit: z.number().int().min(1).max(20).default(5).describe('Max results'),
          source: z
            .enum(['conversations', 'git', 'files'])
            .optional()
            .describe('Filter by source type. Default: all sources.'),
        },
        annotations: {
          readOnlyHint: true,
          destructiveHint: false,
          idempotentHint: true,
          openWorldHint: false,
        },
      },
Behavior4/5

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

Annotations cover readOnly/idempotent/destructive traits. Description adds valuable return value disclosure ('error context + how it was resolved') which compensates for missing output schema. Does not contradict annotations.

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?

Two tightly crafted sentences with zero waste. Purpose front-loaded in first sentence; return values in second. Every word earns its place.

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

Completeness4/5

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

Appropriately complete for a 3-parameter lookup tool with 100% schema coverage and behavioral annotations. Description compensates for missing output schema by summarizing return structure. Could clarify pagination behavior implied by limit parameter.

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%, providing full parameter documentation. Description references 'error message' reinforcing the required parameter's purpose but adds no semantic detail beyond what schema already defines for limit or source.

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?

Clear specific verb 'Find' and resource 'past solutions for an error message'. Effectively distinguishes from generic m9k_search by focusing specifically on error resolution, though lacks explicit contrast with siblings.

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

Usage Guidelines3/5

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

Implies usage context (when encountering error messages) but provides no explicit when-to-use guidance or comparison with alternatives like m9k_search. Agent must infer applicability from the description alone.

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/louis49/melchizedek'

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