Skip to main content

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.
PropertyTypeValue
codestringMISSING_PROVIDE
statusCodenumber500
isPublicbooleanfalse
new MissingProvideError(entityType: string, name: string)
Example:
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).
PropertyTypeValue
codestringINVALID_USE_CLASS
statusCodenumber500
isPublicbooleanfalse
new InvalidUseClassError(entityType: string, tokenName: string)
Example:
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.
PropertyTypeValue
codestringINVALID_USE_FACTORY
statusCodenumber500
isPublicbooleanfalse
new InvalidUseFactoryError(entityType: string, tokenName: string)
Example:
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.
PropertyTypeValue
codestringINVALID_USE_VALUE
statusCodenumber500
isPublicbooleanfalse
new InvalidUseValueError(entityType: string, tokenName: string)
Example:
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.
PropertyTypeValue
codestringINVALID_ENTITY
statusCodenumber500
isPublicbooleanfalse
new InvalidEntityError(entityType: string, name: string, expected: string)
Example:
import { InvalidEntityError } from '@frontmcp/sdk';

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