Skip to main content
Glama
purelledhand

MCP Error Relay

by purelledhand

MCP Error Relay

It relays error logs from other MCP servers when an LLM call fails and the returned error message is unclear, helping the model handle errors more intelligently.

Let's stop burning tokens on your LLMs' blind retries. Give them hints for error from MCP server log.

The Problem

Many MCP servers don’t provide ideal error response. When an MCP tool fails, and if the MCP server gives LLMs bad or empty error response, LLMs just keep retrying same broken call. Same vague error. Each retry burning through your token budget like it's going out of style.

LLMs receive error response from MCP server, but can't see MCP server's error log. for example, MCP tool fails because of the permission issue, but if the MCP doesn’t return a proper error response, LLMs keep calling tools. but in the MCP server log, you can find error message with permission.

this MCP server relay MCP error log to LLMs when it comes to improper error responses.

Related MCP server: error2fix

With mcp-error-relay

MCP Error Relay is a lightweight MCP server which provides MCP server error log to LLMs enabling them to handle errors more intelligently.

Before:

Tool call failed
→ Retry with slightly different params
→ Failed again
→ Retry with even more different params
→ Failed again
→ Give up and ask user

After:

Tool call failed
→ Check logs: "missing_scope: chat:write"
→ Tell user: "You need to add chat:write permission"

Quick Start

# Clone and build
yarn install
yarn build
yarn start

claude_desktop_config.json

{
  "mcpServers": {
    "error-helper": {
      "command": "npx",
      "args": ["-y", "mcp-error-relay@dev"]
    }
  }
}

Contributing

Complete it together please 🥺

Available Tools

3 tools
get_error_detailsA
Read-onlyIdempotent

get detailed error analysis

Use this AFTER getting recent errors when you need actionable solutions and root cause analysis.

WHEN TO USE:

  • You got error logs but need to understand WHY it happened

  • You need specific steps to fix the problem

  • The same error occurred multiple times (pattern analysis)

  • You need stack traces for deeper debugging

WHAT THIS TOOL DOES: ✅ Identifies ROOT CAUSE (not just symptoms) ✅ Provides ACTIONABLE steps to fix the issue ✅ Finds RELATED errors to spot patterns ✅ Analyzes if error is recurring (warns against pointless retries)

WORKFLOW:

  1. Get recent errors using get_recent_errors

  2. Copy the error message you want to analyze

  3. Call THIS tool with that error message

  4. Get: Root cause + Specific fix actions + Pattern warnings

BUILT-IN ERROR PATTERN RECOGNITION:

  • Permission/Auth errors -> Suggests checking credentials, scopes, permissions

  • Rate limit errors -> Suggests backoff strategies, caching, tier upgrades

  • Timeout errors -> Suggests increasing timeout, chunking requests

  • Not found errors -> Suggests verifying IDs, checking deletions

  • Network errors -> Suggests connectivity checks, firewall settings

  • Invalid input errors -> Suggests validation, format checking

  • Server errors (5xx) -> Identifies as provider-side, suggests waiting

EXAMPLE USE CASE: Error: "Failed to send message" → Get recent errors: shows "missing_scope: chat:write" → Analyze error: ROOT CAUSE = "Permission error" ACTIONS = ["Add chat:write OAuth scope", "Regenerate token"] → Fix immediately instead of retrying 4+ times!

Args:

  • server_name (string): Name of the MCP server where error occurred

  • error_message (string): The error message or pattern to search for

  • include_stack_trace (boolean): Include full stack traces (default: false)

  • response_format ('markdown' | 'json'): Output format (default: 'markdown')

Returns: For Markdown format: Human-readable analysis with root cause and action steps For JSON format: Structured data with schema: { "root_cause": string, // Identified root cause of the error "error": { // The original error details "timestamp": string, "server_name": string, "tool_name": string, "message": string, "stack_trace": string // Only if include_stack_trace is true }, "suggested_actions": string[], // List of actionable steps to resolve "related_errors": [ // Similar errors for pattern analysis { "timestamp": string, "message": string } ] }

Examples:

  • Permission error -> { server_name: "slack-mcp-server", error_message: "permission denied" }

  • Rate limit debugging -> { server_name: "github_mcp", error_message: "rate limit", include_stack_trace: true }

  • Recurring error -> { server_name: "jira-mcp-server", error_message: "timeout" }

Error Handling:

  • Returns error if server_name not found

  • Returns "Error not found" if no matching error in logs

  • Provides best-effort analysis even for unknown error patterns

ParametersJSON Schema
NameRequiredDescriptionDefault
server_nameYesName of the MCP server where the error occurred
error_messageYesThe error message or pattern to search for
response_formatNoOutput format: 'markdown' for human-readable or 'json' for machine-readablemarkdown
include_stack_traceNoWhether to include full stack traces in the response (default: false)

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true and idempotentHint=true, so the safety profile is known. The description adds rich behavioral context: it explains the tool performs root-cause analysis, provides pattern warnings, uses 'best-effort analysis even for unknown error patterns', and returns specific error messages like "Error not found". This goes far beyond the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with bolded section headers, bullet lists, and an example workflow, making it skimmable. It is front-loaded with the core purpose and usage. However, it is quite lengthy and somewhat repetitive: the 'WHEN TO USE' list and 'WORKFLOW' section overlap, and the 'WHAT THIS TOOL DOES' section duplicates content from the opening. Still, the structure prevents it from feeling disorganized.

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

Completeness5/5

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

With no output schema, the description must fully document return values, and it does: it spells out both Markdown and JSON response shapes, including a JSON schema example. It also covers error handling, built-in pattern recognition, and examples for different use cases. This is a model of completeness for a complex analysis tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The description repeats parameter names and meanings in the 'Args' section, adding no new detail there, but it enriches understanding with example use cases (e.g., `{ server_name: "slack-mcp-server", error_message: "permission denied" }`) and explains the impact of `response_format` on return structure. This extra context justifies a 4.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with 'get detailed error analysis' and expands with specific capabilities: 'Identifies ROOT CAUSE (not just symptoms)', 'Provides ACTIONABLE steps to fix the issue', and 'Finds RELATED errors to spot patterns'. It distinguishes itself from sibling get_recent_errors by stating 'Use this AFTER getting recent errors', making the purpose unmistakably distinct.

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

Usage Guidelines5/5

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

An explicit 'WHEN TO USE' section lists four clear scenarios, including 'You got error logs but need to understand WHY it happened' and 'The same error occurred multiple times (pattern analysis)'. The workflow step 'Get recent errors using get_recent_errors' directly names the sibling tool as the preceding step, providing clear context and an implied alternative. No misleading exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_recent_errorsA
Read-onlyIdempotent

Get Recent MCP Server Errors

⚠️ CALL THIS IMMEDIATELY when ANY MCP tool fails with vague/unclear error messages!

TRIGGER CONDITIONS - Call this tool when you see:

  • "Error:", "Failed:", "Exception:", "Error occurred"

  • "Permission denied", "Unauthorized", "Forbidden", "Access denied"

  • "Rate limit", "Too many requests", "429"

  • "Timeout", "Timed out", "Connection refused"

  • "Not found", "404", "Invalid", "Malformed"

  • "Network error", "ECONNREFUSED", "ETIMEDOUT"

  • ANY vague error that doesn't explain the root cause

  • BEFORE attempting to retry any failed operation

WHY USE THIS: ❌ Without logs: Blind retry -> fail -> retry -> fail -> retry (wastes 50-200+ tokens) ✅ With logs: Check logs once (10 tokens) -> see real error -> fix immediately

TOKEN ECONOMICS:

  • Cost of checking logs: ~10-20 tokens

  • Cost of 3-4 blind retries: 50-200 tokens

  • ROI: 5-20x token savings per error

WORKFLOW:

  1. MCP tool fails with unclear error

  2. IMMEDIATELY call this tool with server_name

  3. Read the detailed error logs

  4. Identify root cause (permissions? rate limit? invalid input?)

  5. Take correct action (don't retry blindly!)

Args:

  • server_name (string): Name of the MCP server (e.g., 'slack-mcp-server', 'github_mcp')

  • limit (number): Maximum number of errors to return, 1-100 (default: 10)

  • tool_name (string, optional): Filter by specific tool name

  • hours (number, optional): Only show errors from last N hours, 1-168

  • response_format ('markdown' | 'json'): Output format (default: 'markdown')

Returns: For Markdown format: Human-readable error log with timestamps and messages For JSON format: Structured data with schema: { "total": number, // Number of errors found "errors": [ { "timestamp": string, // ISO 8601 timestamp "level": string, // Log level (ERROR) "server_name": string, // MCP server name "tool_name": string, // Tool that caused the error (optional) "message": string, // Error message "error_code": string, // Error code if available (optional) "stack_trace": string, // Stack trace if available (optional) "request_id": string // Request ID for tracing (optional) } ] }

Examples:

  • Slack tool failed -> IMMEDIATELY: { server_name: "slack-mcp-server", limit: 5 }

  • GitHub API error -> BEFORE RETRY: { server_name: "github_mcp", hours: 1 }

  • Repeated failures -> { server_name: "jira-mcp-server", tool_name: "create_issue" }

Error Handling:

  • Returns error if server_name not found. Use list_servers to see available servers.

  • Returns "No errors found" if the log database has no error entries matching the criteria.

ParametersJSON Schema
NameRequiredDescriptionDefault
hoursNoOptional: Only return errors from the last N hours
limitNoMaximum number of error entries to return (default: 10)
tool_nameNoOptional: Filter errors by specific tool name
server_nameYesName of the MCP server to query logs from (e.g., 'slack-mcp-server', 'github_mcp')
response_formatNoOutput format: 'markdown' for human-readable or 'json' for machine-readablemarkdown

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false. The description adds substantial context beyond that: return formats (markdown/json), token economics, error handling ('returns error if server_name not found'), and a full JSON response schema. This fully discloses behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (trigger conditions, why use, token economics, workflow, args, returns, examples, error handling), but it is excessively long. The persuasion and token-economics sections, while informative, could be condensed. Not every sentence earns its place.

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

Completeness5/5

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

Despite having no output schema, the description itself provides a full JSON response schema, detailed parameter explanations, error handling behavior, and multiple examples. It is exceptionally complete for selecting and invoking the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents each parameter. The description adds value through concrete examples ('Slack tool failed -> IMMEDIATELY: { server_name: "slack-mcp-server", limit: 5 }') and contextual usage ('Repeated failures -> { server_name, tool_name }'), elevating the semantics beyond simple field descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool retrieves recent MCP server errors, with a specific verb ('Get'), resource ('Recent MCP Server Errors'), and scope ('from a specific server'). It distinguishes itself from siblings by focusing on error logs rather than details or server lists.

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

Usage Guidelines4/5

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

The description provides extremely explicit trigger conditions and workflow instructions ('CALL THIS IMMEDIATELY when ANY MCP tool fails with vague/unclear error messages', 'BEFORE attempting to retry any failed operation'). However, it does not explicitly contrast with sibling tools (get_error_details, get_server_list) or state when NOT to use this tool, so it falls short of the highest bar.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_server_listA
Read-onlyIdempotent

List Available MCP Servers

Use this tool FIRST if you don't know which MCP server name to use for error checking.

WHEN TO USE:

  • A tool failed but you don't know the exact server_name

  • You want to see which servers have recent errors

  • You're not sure if logs exist for a particular server

  • You need to identify which servers are most problematic

WHAT THIS TOOL SHOWS: ✅ All available MCP server names (needed for other tools) ✅ Total error counts per server ✅ Recent errors in last 24 hours ✅ When logs were last updated ✅ Full log file paths

WORKFLOW:

  1. Tool fails, but you're unsure of the server_name

  2. Call THIS tool to list all available servers

  3. Find the server with recent errors or matching your failed tool

  4. Use that server_name to call get_recent_errors

USE CASES:

  • Error says "slack tool failed" -> List servers -> Find "slack-mcp-server" -> Check its logs

  • Multiple tools failing -> List servers -> See which has most errors (24h column) -> Investigate that one first

  • New to the system -> List servers -> Understand available MCP infrastructure

TIP: Look at the "recent_error_count" (last 24h) to identify servers currently having problems!

Args:

  • include_stats (boolean): Include error statistics for each server (default: true)

  • response_format ('markdown' | 'json'): Output format (default: 'markdown')

Returns: For Markdown format: Human-readable list with server names and stats For JSON format: Structured data with schema: { "total": number, // Number of servers found "servers": [ { "server_name": string, // Name of the MCP server "log_file_path": string, // Full path to log file "last_modified": string, // ISO 8601 timestamp of last update "total_errors": number, // Total error count (if include_stats=true) "recent_error_count": number // Errors in last 24h (if include_stats=true) } ] }

Examples:

  • Don't know server name -> {}

  • Quick server list -> { include_stats: false }

  • Find problematic server -> {} (then check recent_error_count)

Error Handling:

  • Returns empty list if no log files found in configured directory

  • Gracefully handles log files with different formats

ParametersJSON Schema
NameRequiredDescriptionDefault
include_statsNoWhether to include error statistics for each server (default: true)
response_formatNoOutput format: 'markdown' for human-readable or 'json' for machine-readablemarkdown

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnlyHint and idempotentHint, so the safety profile is known. The description adds behavioral context beyond annotations: returns an empty list when no logs exist, gracefully handles varied log formats, and defines the exact output structure for both markdown and JSON responses.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is long but well-organized with sections (WHEN TO USE, WHAT THIS TOOL SHOWS, WORKFLOW, USE CASES, Returns, Examples, Error Handling). The primary purpose is front-loaded in the first line. Minor redundancy exists (the 'use first' guidance appears twice), but overall structure makes the length acceptable.

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

Completeness5/5

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

With no output schema, the description thoroughly explains return values, including a JSON schema for both markdown and json formats, examples, and error handling (empty list, malformed log files). Combined with the annotations and parameter descriptions, an agent has all necessary information to select and invoke this tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema covers 100% of parameters with descriptions, giving a baseline of 3. The description goes further by explaining how 'include_stats' conditionally includes fields (total_errors, recent_error_count) and providing examples of parameter usage, adding practical meaning beyond the schema text.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with 'List Available MCP Servers', a specific verb+resource phrase, and expands on exactly what is listed (server names, error counts, recent errors, log paths). It clearly distinguishes itself from siblings by positioning this as the first step before invoking get_recent_errors or get_error_details.

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

Usage Guidelines5/5

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

The 'WHEN TO USE' section provides concrete scenarios (e.g., 'tool failed but you don't know the exact server_name') and an explicit workflow that names the sibling tool get_recent_errors as the next step. This offers clear guidance on when this tool should be used over alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 3 tool updatesv0.0.1
    • First observedget_error_details
    • First observedget_recent_errors
    • First observedget_server_list

TDQS

A4.7/5.0

Scored across 3 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: listing servers, fetching recent errors, and analyzing a specific error. There is no overlap; the tools are complementary stages of a single diagnostic workflow.

Naming Consistency5/5

All tool names follow the same 'get_' + noun pattern in snake_case (get_recent_errors, get_error_details, get_server_list). The naming is perfectly consistent and predictable.

Tool Count5/5

Three tools is well-scoped for an error relay server. Each tool earns its place, covering discovery, retrieval, and analysis without any redundancy.

Completeness5/5

The tool set covers the full error-diagnosis workflow: discover available servers, retrieve error logs, and get root-cause analysis with actionable fixes. There are no obvious gaps or dead ends.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    An MCP server for intelligent log analysis providing semantic search, error pattern clustering, and smart error detection. It enables users to process, vectorize, and query local logs to efficiently identify issues and generate AI-powered summaries.
    MIT
  • F
    license
    Not graded
    quality
    B
    maintenance
    Provides coding agents with compressed failure context via MCP, reducing the need to parse full raw logs.
    1
    -
  • A
    license
    Not graded
    quality
    A
    maintenance
    Runtime feedback MCP server for AI coding agents. It watches dev server logs, parses errors, and exposes them as MCP tools so AI agents can instantly verify code changes.
    30 npm
    3
    AGPL 3.0
  • A
    license
    Not graded
    quality
    D
    maintenance
    MCP server for collecting and analyzing CLI/web server error logs. Enables watching log files/directories, parsing common error patterns, and querying/analyzing logs through natural language.
    10 npm
    MIT