Class Definition
Constructor
Properties
| Property | Type | Description |
|---|---|---|
runId | string | Unique identifier for this execution (UUID) |
activeStage | string | Current execution stage (default: ‘init’) |
logger | FrontMcpLogger | Logger instance with scope prefix |
Methods
Dependency Injection
get<T>(token)
Get a required dependency from the provider registry.DependencyNotFoundError if token is not registered.
tryGet<T>(token)
Try to get an optional dependency.Context Access
get context()
Get the current request context.RequestContextNotAvailableError if not in request scope.
tryGetContext()
Try to get request context without throwing.Scope Access
get scope
Get the current scope with all registries.Authentication
getAuthInfo()
Get authentication information for the current request.Execution Tracking
mark(stage)
Mark the current execution stage for debugging and profiling.Error Handling
fail(err)
Fail the execution with an error.get error
Get the current error, if any.HTTP Requests
fetch(input, init?)
Make HTTP requests with auto-injected headers.- Authorization headers
- Trace context headers
- Custom headers from context
Configuration
get config
Get typed configuration access (requires ConfigPlugin).Protected Logger
get contextLogger
Get a child logger with request context.Usage Example
Related
ToolContext
Tool-specific context
ResourceContext
Resource-specific context
AgentContext
Agent-specific context
ProviderRegistry
Dependency injection