mcp-ai-agent-guidelines
Version:
A comprehensive Model Context Protocol server providing advanced tools, resources, and prompts for implementing AI agent best practices
49 lines • 1.48 kB
TypeScript
/**
* Centralized error codes following numbering convention:
* - 1xxx: Validation Errors
* - 2xxx: Domain Errors
* - 3xxx: Session Errors
* - 4xxx: External Errors
* - 5xxx: Configuration Errors
* - 9xxx: Internal Errors
*/
export declare enum ErrorCode {
VALIDATION_FAILED = 1000,
MISSING_REQUIRED_FIELD = 1001,
INVALID_FORMAT = 1002,
SCHEMA_VIOLATION = 1003,
OUT_OF_RANGE = 1004,
INVALID_PARAMETER = 1005,
DOMAIN_ERROR = 2000,
INVALID_STATE = 2001,
CONSTRAINT_VIOLATION = 2002,
BUSINESS_RULE_VIOLATION = 2003,
SESSION_NOT_FOUND = 3000,
SESSION_EXPIRED = 3001,
INVALID_PHASE_TRANSITION = 3002,
COVERAGE_NOT_MET = 3003,
FILE_NOT_FOUND = 4000,
FILE_READ_ERROR = 4001,
FILE_WRITE_ERROR = 4002,
NETWORK_ERROR = 4003,
RESOURCE_NOT_FOUND = 4004,
CONFIG_NOT_FOUND = 5000,
CONFIG_INVALID = 5001,
MISSING_DEPENDENCY = 5002,
INTERNAL_ERROR = 9000,
NOT_IMPLEMENTED = 9001,
UNEXPECTED_STATE = 9002
}
/**
* Human-readable error messages for each error code
*/
export declare const ERROR_MESSAGES: Record<ErrorCode, string>;
/**
* Determines if an error code represents a retryable error.
* Only external errors (4xxx) are considered retryable as they may be transient.
*
* @param code - The error code to check
* @returns true if the error is retryable, false otherwise
*/
export declare function isRetryable(code: ErrorCode): boolean;
//# sourceMappingURL=error-codes.d.ts.map