# Class ToolError

Structured error class that all MCP tools use for consistent error reporting. Ensures tool name, operation, and safe context are always included without leaking internal implementation details to clients.

#### Hierarchy

- Error
  - ToolError

- Defined in tools/shared/errors.ts:39

##### Index

### Constructors

constructor

### Properties

isRetryable
operation
toolName
cause?
errorCategory?
errorCode?
httpStatus?

## Constructors

### constructor

- new ToolError(
  options: {
  message: string;
  operation: string;
  toolName: string;
  cause?: unknown;
  errorCategory?: ErrorCategory;
  errorCode?: ErrorCode;
  httpStatus?: number;
  isRetryable?: boolean;
  },
  ): ToolError

  #### Parameters

  - options: {
    message: string;
    operation: string;
    toolName: string;
    cause?: unknown;
    errorCategory?: ErrorCategory;
    errorCode?: ErrorCode;
    httpStatus?: number;
    isRetryable?: boolean;
    }

  #### Returns ToolError

  Overrides Error.constructor

  - Defined in tools/shared/errors.ts:48

## Properties

### `Readonly` isRetryable

isRetryable: boolean

- Defined in tools/shared/errors.ts:42

### `Readonly` operation

operation: string

- Defined in tools/shared/errors.ts:41

### `Readonly` toolName

toolName: string

- Defined in tools/shared/errors.ts:40

### `Optional` `Readonly` cause

cause?: Error

Overrides Error.cause

- Defined in tools/shared/errors.ts:46

### `Optional` `Readonly` errorCategory

errorCategory?: ErrorCategory

- Defined in tools/shared/errors.ts:44

### `Optional` `Readonly` errorCode

errorCode?: ErrorCode

- Defined in tools/shared/errors.ts:43

### `Optional` `Readonly` httpStatus

httpStatus?: number

- Defined in tools/shared/errors.ts:45