mcp-error-code-mapper

Solid

Map application errors to MCP error codes with proper messages, error types, and recovery suggestions.

AI & Automation 814 stars 53 forks Updated today MIT

Install

View on GitHub

Quality Score: 95/100

Stars 20%
97
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# MCP Error Code Mapper Map application errors to MCP error codes with proper handling. ## Capabilities - Map errors to MCP error codes - Create structured error responses - Generate error documentation - Implement error recovery hints - Configure error serialization - Create error handler utilities ## Usage Invoke this skill when you need to: - Map application errors to MCP errors - Create structured error responses - Implement error handling for tools - Generate error documentation ## Inputs | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | language | string | Yes | Target language | | errors | array | Yes | Error definitions | | includeRecovery | boolean | No | Include recovery hints | ### Error Structure ```json { "errors": [ { "name": "FileNotFound", "mcpCode": -32002, "message": "File not found: {path}", "recovery": "Check if the file exists and the path is correct" }, { "name": "InvalidInput", "mcpCode": -32602, "message": "Invalid input: {reason}", "recovery": "Review the input parameters and try again" } ] } ``` ## Generated Patterns ### TypeScript Error Mapper ```typescript import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js'; // Standard MCP Error Codes export const MCP_ERROR_CODES = { PARSE_ERROR: -32700, INVALID_REQUEST: -32600, METHOD_NOT_FOUND: -32601, INVALID_PARAMS: -32602, INTERNAL_ERROR: -32603, // Cust...

Details

Author
a5c-ai
Repository
a5c-ai/babysitter
Created
4 months ago
Last Updated
today
Language
JavaScript
License
MIT

Related Skills