Skip to main content

Overview

Agent errors cover the full lifecycle of agent operations — from not-found and configuration issues to execution failures, loop limits, timeouts, and LLM adapter problems.

Error Reference

AgentNotFoundError

Thrown when a requested agent is not registered.
PropertyTypeValue
codestringAGENT_NOT_FOUND
statusCodenumber404
isPublicbooleantrue
agentIdstringThe requested agent ID
new AgentNotFoundError(agentId: string)
Example:
import { AgentNotFoundError } from '@frontmcp/sdk';

throw new AgentNotFoundError('code-reviewer');

AgentExecutionError

Thrown when an agent’s execution fails unexpectedly. This is an internal error.
PropertyTypeValue
codestringAGENT_EXECUTION_FAILED
statusCodenumber500
isPublicbooleanfalse
agentIdstringThe agent that failed
originalErrorError | undefinedThe underlying cause
new AgentExecutionError(agentId: string, cause?: Error)
Example:
import { AgentExecutionError } from '@frontmcp/sdk';

try {
  await agent.run(input);
} catch (error) {
  throw new AgentExecutionError('code-reviewer', error);
}

AgentLoopExceededError

Thrown when an agent exceeds its maximum iteration count.
PropertyTypeValue
codestringAGENT_LOOP_EXCEEDED
statusCodenumber400
isPublicbooleantrue
agentIdstringThe agent that looped
maxIterationsnumberConfigured maximum
actualIterationsnumberHow many iterations ran
new AgentLoopExceededError(agentId: string, maxIterations: number, actualIterations?: number)
Example:
import { AgentLoopExceededError } from '@frontmcp/sdk';

throw new AgentLoopExceededError('planner', 10, 11);

AgentTimeoutError

Thrown when an agent exceeds its configured timeout.
PropertyTypeValue
codestringAGENT_TIMEOUT
statusCodenumber408
isPublicbooleantrue
agentIdstringThe timed-out agent
timeoutMsnumberConfigured timeout in milliseconds
new AgentTimeoutError(agentId: string, timeoutMs: number)
Example:
import { AgentTimeoutError } from '@frontmcp/sdk';

throw new AgentTimeoutError('planner', 30000);

AgentVisibilityError

Thrown when an agent attempts to invoke another agent it doesn’t have visibility to.
PropertyTypeValue
codestringAGENT_VISIBILITY_DENIED
statusCodenumber403
isPublicbooleantrue
requestingAgentIdstringThe caller agent
targetAgentIdstringThe target agent
new AgentVisibilityError(requestingAgentId: string, targetAgentId: string)
Example:
import { AgentVisibilityError } from '@frontmcp/sdk';

throw new AgentVisibilityError('assistant', 'admin-agent');

AgentLlmError

Thrown when the LLM adapter (e.g., OpenAI, Anthropic) fails during agent execution. This is an internal error.
PropertyTypeValue
codestringAGENT_LLM_ERROR
statusCodenumber500
isPublicbooleanfalse
agentIdstringThe agent using the adapter
originalErrorError | undefinedThe underlying cause
new AgentLlmError(agentId: string, cause?: Error)
Example:
import { AgentLlmError } from '@frontmcp/sdk';

throw new AgentLlmError('planner', new Error('Rate limited by provider'));

AgentConfigurationError

Thrown when an agent has invalid configuration.
PropertyTypeValue
codestringAGENT_CONFIGURATION_ERROR
statusCodenumber500
isPublicbooleantrue
agentIdstring | undefinedThe misconfigured agent
configErrorsstring[]List of configuration errors
new AgentConfigurationError(message: string, options?: {
  agentId?: string;
  errors?: string[];
})
Example:
import { AgentConfigurationError } from '@frontmcp/sdk';

throw new AgentConfigurationError('Missing model configuration', {
  agentId: 'planner',
  errors: ['model is required', 'tools must be a non-empty array'],
});

AgentNotConfiguredError

Thrown when an agent doesn’t have an LLM adapter configured. This is an internal error.
PropertyTypeValue
codestringAGENT_NOT_CONFIGURED
statusCodenumber500
isPublicbooleanfalse
agentNamestringThe unconfigured agent
new AgentNotConfiguredError(agentName: string)
Example:
import { AgentNotConfiguredError } from '@frontmcp/sdk';

throw new AgentNotConfiguredError('planner');
// "Agent "planner" has no LLM adapter configured"

AgentToolNotFoundError

Thrown when a tool is not found in the agent’s allowed tool scope. This is an internal error.
PropertyTypeValue
codestringAGENT_TOOL_NOT_FOUND
statusCodenumber500
isPublicbooleanfalse
agentNamestringThe agent that requested the tool
toolNamestringThe missing tool
availableToolsstring[]Tools available to the agent
new AgentToolNotFoundError(agentName: string, toolName: string, availableTools: string[])
Example:
import { AgentToolNotFoundError } from '@frontmcp/sdk';

throw new AgentToolNotFoundError('planner', 'delete_user', ['list_users', 'get_user']);