Errors & Registry
Errors
ts
class SimpleWebMCPError extends Error { code: string; cause?: unknown; toJSON(); }
class NotSupportedError extends SimpleWebMCPError // code 'NOT_SUPPORTED'
class NotAllowedError extends SimpleWebMCPError // code 'NOT_ALLOWED' — Permissions Policy
class RegistrationError extends SimpleWebMCPError // code 'REGISTRATION_ERROR'
class ValidationError extends SimpleWebMCPError // code 'VALIDATION_ERROR'
class ConfigurationError extends SimpleWebMCPError // code 'CONFIGURATION_ERROR' — e.g. strict inferenceSee Browser Support for NotSupportedError / NotAllowedError handling and Schema for strict validation.
Registry
ts
import { registry, getRegistry } from 'simple-webmcp';
registry.list(); // [{name, status}]
registry.clear();
registry.isRegistered(name);
registry.getStatus(name);Async register(contract, {signal, execute}) → ()=>void unregister. Deduped; NotAllowedError on NotAllowedError/Permissions Policy message.
See also
- Guide — Browser Support — feature detection + polyfill
- Guide — Hooks — error hooks are observational
- Analytics — Sentry — reporting via error hooks
- Schema & Inference —
strictand validation - External: Chrome WebMCP API