> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentfront.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Normalization Errors

> Errors for invalid provider and entity definitions during normalization.

## Overview

Normalization errors are thrown during the normalization phase when provider or entity definitions have invalid shapes. This phase converts raw decorator metadata into normalized internal records. All normalization errors are internal errors.

## Error Reference

### MissingProvideError

Thrown when a provider/entity definition is missing the `provide` token.

| Property     | Type      | Value             |
| ------------ | --------- | ----------------- |
| `code`       | `string`  | `MISSING_PROVIDE` |
| `statusCode` | `number`  | `500`             |
| `isPublic`   | `boolean` | `false`           |

```typescript theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
new MissingProvideError(entityType: string, name: string)
```

**Example:**

```typescript theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
import { MissingProvideError } from '@frontmcp/sdk';

throw new MissingProvideError('Provider', 'DatabaseService');
// "Provider 'DatabaseService' is missing 'provide'."
```

***

### InvalidUseClassError

Thrown when `useClass` on a provider/entity is not a valid class (constructor function).

| Property     | Type      | Value               |
| ------------ | --------- | ------------------- |
| `code`       | `string`  | `INVALID_USE_CLASS` |
| `statusCode` | `number`  | `500`               |
| `isPublic`   | `boolean` | `false`             |

```typescript theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
new InvalidUseClassError(entityType: string, tokenName: string)
```

**Example:**

```typescript theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
import { InvalidUseClassError } from '@frontmcp/sdk';

throw new InvalidUseClassError('Provider', 'DatabaseService');
// "'useClass' on Provider 'DatabaseService' must be a class."
```

***

### InvalidUseFactoryError

Thrown when `useFactory` on a provider/entity is not a function.

| Property     | Type      | Value                 |
| ------------ | --------- | --------------------- |
| `code`       | `string`  | `INVALID_USE_FACTORY` |
| `statusCode` | `number`  | `500`                 |
| `isPublic`   | `boolean` | `false`               |

```typescript theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
new InvalidUseFactoryError(entityType: string, tokenName: string)
```

**Example:**

```typescript theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
import { InvalidUseFactoryError } from '@frontmcp/sdk';

throw new InvalidUseFactoryError('Provider', 'ConfigService');
// "'useFactory' on Provider 'ConfigService' must be a function."
```

***

### InvalidUseValueError

Thrown when `useValue` on a provider/entity is `undefined`.

| Property     | Type      | Value               |
| ------------ | --------- | ------------------- |
| `code`       | `string`  | `INVALID_USE_VALUE` |
| `statusCode` | `number`  | `500`               |
| `isPublic`   | `boolean` | `false`             |

```typescript theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
new InvalidUseValueError(entityType: string, tokenName: string)
```

**Example:**

```typescript theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
import { InvalidUseValueError } from '@frontmcp/sdk';

throw new InvalidUseValueError('Provider', 'API_KEY');
// "'useValue' on Provider 'API_KEY' must be defined."
```

***

### InvalidEntityError

Thrown when an entity (tool, resource, adapter, etc.) has an invalid shape.

| Property     | Type      | Value            |
| ------------ | --------- | ---------------- |
| `code`       | `string`  | `INVALID_ENTITY` |
| `statusCode` | `number`  | `500`            |
| `isPublic`   | `boolean` | `false`          |

```typescript theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
new InvalidEntityError(entityType: string, name: string, expected: string)
```

**Example:**

```typescript theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
import { InvalidEntityError } from '@frontmcp/sdk';

throw new InvalidEntityError('Tool', 'my_tool', 'a class extending ToolContext');
// "Invalid Tool 'my_tool'. Expected a class extending ToolContext."
```
