TheDocumentation Index
Fetch the complete documentation index at: https://docs.dedaluslabs.ai/llms.txt
Use this file to discover all available pages before exploring further.
Context object gives you access to request-scoped utilities while a tool/resource/prompt is executing—primarily logging, progress, and request metadata.
Use get_context() to fetch the active context.
Note: get_context() only works inside an active MCP request handler. Calling it elsewhere raises LookupError.
Get Context
Auto-injection (tools + dependencies)
In tools (and dependency callables), parameters annotated asContext can be auto-injected by the framework—no need to call get_context() manually:
Available features
| Feature | API | What it does |
|---|---|---|
| Logging | ctx.debug(), ctx.info(), ctx.warning(), ctx.error(), ctx.log() | Send log messages to the client |
| Request metadata | ctx.request_id, ctx.session_id, ctx.progress_token | Identify the current request/session and progress token |
| Server/runtime access | ctx.server, ctx.runtime | Access runtime wiring (if present) |
| Auth context | ctx.auth_context | Access the auth context (if authorization is enabled) |
| Progress | ctx.report_progress(...), ctx.progress(...) | Emit progress notifications (if the client provided a progress token) |
| Dispatch (optional) | ctx.dispatch(...) | Send authenticated HTTP requests via the configured dispatch backend (if configured) |
| Connection resolution (optional) | ctx.resolve_client(...) | Resolve a connection handle into a client via the configured resolver (if configured) |
Request metadata
Authorization context
If authorization is enabled,ctx.auth_context may be set; otherwise it’s None:
