Primitives, Controllers & Skills API¶
API reference for MCP decorators (@mcp_tool, @mcp_resource, @mcp_prompt), description validation (validate_tool_descriptions), class-based PromptController and SkillController routers, Agent Skills (SkillSource, FilesystemSkillSource, Skill, SkillFile, SkillCatalog, SkillIntegrityError), structured content return types, the Registry, and MCPHandlerService request context helpers.
For usage guides, see Marking Routes & Decorators, Tools & Annotations, Resources & URI Templates, Prompts & PromptController, and Agent Skills (SEP-2640).
Route & Function Decorators¶
mcp_tool
¶
mcp_tool(
name=None,
*,
description=None,
agent_instructions=None,
when_to_use=None,
returns=None,
input_schema=None,
output_schema=None,
annotations=None,
read_only=None,
scopes=None,
task=None,
task_support=None,
task_input_before_start=False,
queue=None,
)
Decorator to mark a route handler as an MCP tool.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str | None
|
The name of the MCP tool. Defaults to the function name. |
None
|
description
|
str | None
|
LLM-facing description. Overrides |
None
|
agent_instructions
|
str | None
|
Mandatory-context block rendered in the
|
None
|
when_to_use
|
str | None
|
Optional structured hint for LLM clients — rendered as
the |
None
|
returns
|
str | None
|
Optional return-shape hint — rendered as the |
None
|
input_schema
|
dict[str, Any] | None
|
Optional explicit JSON Schema for the tool input. |
None
|
output_schema
|
dict[str, Any] | None
|
Optional JSON Schema for the tool's structured output. |
None
|
annotations
|
dict[str, Any] | None
|
Optional metadata annotations (audience, priority, etc.). |
None
|
read_only
|
bool | None
|
Optional shorthand setting |
None
|
scopes
|
list[str] | None
|
Optional list of OAuth scopes advertised as discovery
metadata (surfaced under |
None
|
task
|
str | bool | None
|
Preferred task mode parameter. Accepts |
None
|
task_support
|
str | bool | None
|
Optional task support mode alias for |
None
|
task_input_before_start
|
bool
|
Execute the first call synchronously so an MRTR input-required result can be completed before creating the task on the retry. |
False
|
queue
|
str | bool | None
|
Optional target |
None
|
Returns:
| Type | Description |
|---|---|
Callable[[F], F]
|
Decorator function that adds MCP metadata to the handler. |
Example
Pass MCP metadata straight through to the route decorator —
Litestar funnels unknown kwargs into handler.opt, so no
double-decoration is required:
@get("/users", mcp_tool="user_manager", mcp_description="List every user.")
async def get_users() -> list[dict]:
return [{"id": 1, "name": "Alice"}]
The decorator form is retained for parity; it carries the same
metadata to the registry and is useful when you want to stamp
an explicit input_schema / output_schema, annotations,
scopes, or task/MRTR policy without mixing more keys into
handler.opt.
mcp_resource
¶
mcp_resource(
name=None,
*,
uri_template=None,
mime_type=None,
description=None,
agent_instructions=None,
when_to_use=None,
returns=None,
)
Decorator to mark a route handler as an MCP resource.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str | None
|
The name of the MCP resource. Defaults to the function name. |
None
|
uri_template
|
str | None
|
Optional RFC 6570 Level 1 URI template
(e.g. |
None
|
mime_type
|
str | None
|
Optional resource MIME type advertised in list responses and used as a fallback for resource reads. |
None
|
description
|
str | None
|
LLM-facing description. Overrides |
None
|
agent_instructions
|
str | None
|
Mandatory-context block rendered in the
|
None
|
when_to_use
|
str | None
|
Optional structured hint rendered as the
|
None
|
returns
|
str | None
|
Optional return-shape hint rendered as the |
None
|
Returns:
| Type | Description |
|---|---|
Callable[[F], F]
|
Decorator function that adds MCP metadata to the handler. |
Example
Pass MCP metadata straight through to the route decorator —
Litestar funnels unknown kwargs into handler.opt:
@get("/config", mcp_resource="app_config")
async def get_config() -> dict:
return {"debug": True}
@get(
"/workspaces/{workspace_id:str}/files/{file_id:str}",
mcp_resource="workspace_file",
mcp_resource_template="app://workspaces/{workspace_id}/files/{file_id}",
)
async def read_workspace_file(workspace_id: str, file_id: str) -> dict:
...
The decorator form is retained for parity; it carries the same metadata to the registry.
mcp_prompt
¶
Decorator to mark a callable as an MCP prompt template.
Prompt functions take keyword arguments matching the declared prompt
arguments and return prompt messages. The return value is normalised
to a list of PromptMessage dicts:
str→ single{"role": "user", "content": {"type": "text", "text": ...}}dict→ treated as a single message and wrapped in a listlist[dict]→ used directly- Any other type →
str(result)wrapped as a single user text message
Both sync and async callables are supported.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str | None
|
Unique identifier for the prompt (used in |
None
|
title
|
str | None
|
Optional human-readable display name for UI clients. |
None
|
description
|
str | None
|
LLM-facing description. When omitted, |
None
|
arguments
|
list[dict[str, Any]] | None
|
Optional explicit argument definitions — each entry is a
dict with |
None
|
icons
|
list[dict[str, Any]] | None
|
Optional list of icon objects for UI display. Each entry is a
dict with |
None
|
Returns:
| Type | Description |
|---|---|
Callable[[F], F]
|
Decorator function that adds MCP metadata to the callable. |
validate_tool_descriptions
¶
validate_tool_descriptions(
tools,
*,
max_tool_description_length=1000,
max_param_description_length=750,
max_output_field_description_length=300,
)
Validate tool, input parameter, and output schema field description lengths.
Class-Based Controllers¶
PromptController
¶
Bases: Controller
Litestar controller whose @prompt methods are served as MCP prompts.
Attributes:
| Name | Type | Description |
|---|---|---|
prefix | str | None | Optional namespace prepended to prompt names as |
instructions | str | None | Text prepended to the first user message of every prompt result. |
qualify_prompt_name
¶
Return the registered prompt name for name under this controller's prefix.
prompt
¶
Mark a controller method as an MCP prompt served through the controller's guards and dependencies.
SkillController
¶
Bases: PromptController
Prompt controller that also serves @tool methods as MCP tools and exposes them to agents.
Attributes:
| Name | Type | Description |
|---|---|---|
name | str | Skill identifier, also the default prompt prefix and A2A skill id. |
description | str | Skill description for A2A cards. |
tags | Sequence[str] | None | Optional categorization tags for discovery. |
examples | tuple[str, ...] | Example requests for A2A cards. |
qualify_prompt_name
¶
Namespace prompts under prefix, falling back to name.
Agent Skills (io.modelcontextprotocol/skills)¶
SkillSource
¶
Bases: Protocol
Async, request-aware source of Agent Skills.
FilesystemSkillSource
¶
Eager, digest-locked filesystem source of Agent Skills.
Attributes:
| Name | Type | Description |
|---|---|---|
paths | tuple[Path, ...] | Configured root directories searched by this source. |
skills | tuple[Skill, ...] | Loaded skills sorted by |
Skill
¶
One skill loaded from a skill directory or constructed dynamically.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Skill identifier, matching the |
required |
description
|
str
|
Human-readable summary from frontmatter. |
required |
uri
|
str
|
Canonical |
required |
frontmatter
|
dict[str, Any]
|
Full parsed YAML frontmatter mapping, preserved verbatim. |
required |
files
|
tuple[SkillFile, ...]
|
Every file belonging to the skill, sorted by |
required |
Attributes:
| Name | Type | Description |
|---|---|---|
name | str | Skill identifier, matching the |
description | str | Human-readable summary from frontmatter. |
uri | str | Canonical |
frontmatter | dict[str, Any] | Full parsed YAML frontmatter mapping, preserved verbatim. |
files | tuple[SkillFile, ...] | Every file belonging to the skill, sorted by |
SkillFile
¶
One file inside a skill folder or dynamic skill manifest.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
relative_path
|
str
|
Forward-slash path relative to the skill root. |
required |
path
|
Path | None
|
Absolute filesystem path on disk, or |
required |
uri
|
str
|
Canonical |
required |
mime_type
|
str
|
Resolved MIME type ( |
required |
size
|
int
|
Byte length recorded in the skill manifest. |
required |
digest
|
str
|
|
required |
content
|
bytes | None
|
Optional inline byte payload served without calling |
None
|
Attributes:
| Name | Type | Description |
|---|---|---|
relative_path | str | Forward-slash path relative to the skill root. |
path | Path | None | Absolute filesystem path on disk, or |
uri | str | Canonical |
mime_type | str | Resolved MIME type ( |
size | int | Byte length recorded in the skill manifest. |
digest | str |
|
content | bytes | None | Optional inline byte payload served without calling |
SkillCatalog
¶
Request-aware composition of SkillSource instances.
Attributes:
| Name | Type | Description |
|---|---|---|
sources | tuple[SkillSource, ...] | Tuple of composed |
from_config
¶
Build a catalog from config (paths first as FilesystemSkillSource, then sources).
list_skills
¶
Return every skill visible to request across all sources, deduplicated and sorted by name.
get
¶
Return the skill whose canonical skill://<name>/SKILL.md URI equals uri, else None.
list_directory
¶
List direct file and directory children under uri, or None if not a visible directory.
resource_entries
¶
Return resources/list entries for every file in every visible skill.
read_file
¶
Read match.file (inline or via match.source.read_file) and verify size and digest.
SkillIntegrityError
¶
Bases: Exception
Raised when a skill file's on-disk or source-returned bytes no longer match its manifest digest.
Content Blocks & Return Helpers¶
MCPToolResult
¶
A complete MCP tool result with explicit content blocks.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
content
|
Any
|
One or more content blocks (or values normalized into content blocks). |
required |
structured_content
|
Any
|
Optional structured JSON payload emitted under |
<object object at 0x7f0a4019ce20>
|
is_error
|
bool
|
Whether the tool result represents an execution error ( |
False
|
meta
|
dict[str, Any] | None
|
Optional |
None
|
Attributes:
| Name | Type | Description |
|---|---|---|
content | Any | One or more content blocks (or values normalized into content blocks). |
structured_content | Any | Optional structured JSON payload emitted under |
is_error | bool | Whether the tool result represents an execution error ( |
meta | dict[str, Any] | None | Optional |
MCPResourceLink
¶
A tool-result content block linking to a fetchable MCP resource.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Logical resource name. |
required |
uri
|
str
|
Target MCP resource URI. |
required |
mime_type
|
str | None
|
Optional MIME type of the linked resource. |
None
|
description
|
str | None
|
Optional human- or LLM-readable description of the linked resource. |
None
|
title
|
str | None
|
Optional display title for the resource link. |
None
|
size
|
int | None
|
Optional size of the linked resource in bytes. |
None
|
annotations
|
dict[str, Any] | None
|
Optional MCP content annotations attached to the resource link. |
None
|
meta
|
dict[str, Any] | None
|
Optional |
None
|
Attributes:
| Name | Type | Description |
|---|---|---|
name | str | Logical resource name. |
uri | str | Target MCP resource URI. |
mime_type | str | None | Optional MIME type of the linked resource. |
description | str | None | Optional human- or LLM-readable description of the linked resource. |
title | str | None | Optional display title for the resource link. |
size | int | None | Optional size of the linked resource in bytes. |
annotations | dict[str, Any] | None | Optional MCP content annotations attached to the resource link. |
meta | dict[str, Any] | None | Optional |
MCPBlobResource
¶
A tool-result embedded resource backed by bytes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
uri
|
str
|
Canonical URI identifying the embedded binary resource. |
required |
data
|
bytes | bytearray | memoryview
|
Raw binary payload encoded as base64 in the MCP content block. |
required |
mime_type
|
str
|
MIME type of the binary payload. |
'application/octet-stream'
|
annotations
|
dict[str, Any] | None
|
Optional MCP annotations attached to the embedded resource. |
None
|
meta
|
dict[str, Any] | None
|
Optional |
None
|
Attributes:
| Name | Type | Description |
|---|---|---|
uri | str | Canonical URI identifying the embedded binary resource. |
data | bytes | bytearray | memoryview | Raw binary payload encoded as base64 in the MCP content block. |
mime_type | str | MIME type of the binary payload. |
annotations | dict[str, Any] | None | Optional MCP annotations attached to the embedded resource. |
meta | dict[str, Any] | None | Optional |
to_content_block
¶
Return the MCP embedded resource content block.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
max_blob_bytes
|
int | None
|
Optional byte limit enforced before base64 encoding. |
None
|
MCPInputRequiredResult
¶
Typed MCP multi-round-trip input request result.
request_state crosses an untrusted client boundary. Applications MUST
authenticate and integrity-protect it (for example with AEAD or an HMAC)
before placing authorization-sensitive state in this field.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_requests
|
dict[str, dict[str, Any]] | None
|
Map of input request identifiers to client input request descriptors. |
None
|
request_state
|
str | None
|
Opaque integrity-protected state token round-tripped through the client. |
None
|
Attributes:
| Name | Type | Description |
|---|---|---|
input_requests | dict[str, dict[str, Any]] | None | Map of input request identifiers to client input request descriptors. |
request_state | str | None | Opaque integrity-protected state token round-tripped through the client. |
PromptMessage
¶
An MCP PromptMessage with a user or assistant role and one content block.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
role
|
Literal['user', 'assistant']
|
Message speaker role ( |
required |
content
|
dict[str, Any]
|
MCP content block dictionary for the prompt message. |
required |
Attributes:
| Name | Type | Description |
|---|---|---|
role | Literal['user', 'assistant'] | Message speaker role ( |
content | dict[str, Any] | MCP content block dictionary for the prompt message. |
Discovery Registry¶
Registry
¶
Central registry for MCP tools, resources, and prompts.
This class decouples metadata storage and discovery from the route handlers themselves, avoiding issues with slots or object mutation.
Note
Tools and resources are stored as bare BaseRouteHandler values
because every entry has a single underlying handler. Prompts use
PromptRegistration instead — a prompt may originate from
either a standalone @mcp_prompt callable or a route handler,
so the dataclass carries the fn | handler union plus the
per-prompt metadata (title, description, arguments, icons) that
can't live on a bare callable.
Attributes:
| Name | Type | Description |
|---|---|---|
subscription_manager | SubscriptionManager | Return the configured subscription manager. |
tools | dict[str, BaseRouteHandler] | Get registered tools. |
resources | dict[str, BaseRouteHandler] | Get registered resources. |
templates | dict[str, ResourceTemplate] | Get registered resource templates, keyed by resource name. |
prompts | dict[str, PromptRegistration] | Get registered prompts. |
register_change_callback
¶
Register a callback to be invoked when the registry changes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
callback
|
Callable[[], None]
|
The callback function. |
required |
unregister_change_callback
¶
Unregister a change callback.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
callback
|
Callable[[], None]
|
The callback function to remove. |
required |
set_subscription_manager
¶
Set the subscription manager for notifications.
register_tool
¶
Register a tool.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The tool name. |
required |
handler
|
BaseRouteHandler
|
The route handler. |
required |
register_resource
¶
Register a resource.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The resource name. |
required |
handler
|
BaseRouteHandler
|
The route handler. |
required |
register_resource_template
¶
Register an RFC 6570 Level 1 URI template for a resource.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The resource name (same key as |
required |
handler
|
BaseRouteHandler
|
The route handler bound to the template. |
required |
template
|
str
|
The URI template string. Validated at registration;
invalid templates raise |
required |
register_prompt
¶
Register a standalone prompt function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Unique prompt identifier. |
required |
fn
|
Callable[..., Any]
|
The callable to invoke on |
required |
title
|
str | None
|
Optional human-readable display name. |
None
|
description
|
str | None
|
Optional description. Falls back to |
None
|
arguments
|
list[dict[str, Any]] | None
|
Explicit argument definitions. When |
None
|
icons
|
list[dict[str, Any]] | None
|
Optional list of icon objects for UI display. |
None
|
register_prompt_handler
¶
register_prompt_handler(
name,
handler,
*,
title=None,
description=None,
arguments=None,
icons=None,
instructions=None,
)
Register a route-handler-based prompt.
Storage only — runtime dispatch and the
messages-passthrough vs. normalize-on-return decision live in
litestar_mcp.mcp.routes.handle_prompts_get. This function
captures the handler reference plus any explicit overrides so the
registry can render prompts/list entries without executing
the handler.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Unique prompt identifier. |
required |
handler
|
BaseRouteHandler
|
The Litestar route handler. |
required |
title
|
str | None
|
Optional human-readable display name. |
None
|
description
|
str | None
|
Optional description. |
None
|
arguments
|
list[dict[str, Any]] | None
|
Explicit argument definitions. When |
None
|
icons
|
list[dict[str, Any]] | None
|
Optional list of icon objects for UI display. |
None
|
instructions
|
str | None
|
Grounding instructions prepended to prompt output. |
None
|
publish_notification
¶
Publish a JSON-RPC 2.0 notification to connected clients.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
method
|
str
|
The notification method (e.g., 'notifications/resources/updated'). |
required |
params
|
dict[str, Any]
|
The notification parameters. |
required |
notify_resource_updated
¶
Notify clients that a resource has been updated.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
uri
|
str
|
The URI of the updated resource. |
required |
notify_tools_list_changed
¶
Notify clients that the tool list has changed.
notify_prompts_list_changed
¶
Notify clients that the prompt list has changed.
ResourceTemplate
¶
A declared RFC 6570 Level 1 URI template bound to a resource handler.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Logical resource name. |
required |
template
|
str
|
RFC 6570 Level 1 URI template string. |
required |
handler
|
BaseRouteHandler
|
Litestar route handler bound to the URI template. |
required |
Attributes:
| Name | Type | Description |
|---|---|---|
name | str | Logical resource name. |
template | str | RFC 6570 Level 1 URI template string. |
handler | BaseRouteHandler | Litestar route handler bound to the URI template. |
PromptRegistration
¶
A registered MCP prompt — either a standalone callable or a route handler.
Standalone prompts are plain (async) functions decorated with
@mcp_prompt and passed to LitestarMCP(prompts=[...]).
Handler-based prompts are Litestar route handlers discovered via the
mcp_prompt opt key, executed through the normal Litestar pipeline.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Unique prompt identifier used in |
required |
fn
|
Callable[..., Any] | None
|
The callable to invoke for standalone prompt functions. |
None
|
handler
|
BaseRouteHandler | None
|
The Litestar route handler for handler-based prompts. |
None
|
title
|
str | None
|
Optional human-readable display name. |
None
|
description
|
str | None
|
Optional LLM-facing description. |
None
|
arguments
|
list[dict[str, Any]] | None
|
Explicit argument definitions, or |
None
|
icons
|
list[dict[str, Any]] | None
|
Optional list of icon objects for UI display. |
None
|
instructions
|
str | None
|
Optional grounding instructions prepended to rendered prompt messages. |
None
|
Attributes:
| Name | Type | Description |
|---|---|---|
name | str | Unique prompt identifier used in |
fn | Callable[..., Any] | None | The callable to invoke for standalone prompt functions. |
handler | BaseRouteHandler | None | The Litestar route handler for handler-based prompts. |
title | str | None | Optional human-readable display name. |
description | str | None | Optional LLM-facing description. |
arguments | list[dict[str, Any]] | None | Explicit argument definitions, or |
icons | list[dict[str, Any]] | None | Optional list of icon objects for UI display. |
instructions | str | None | Optional grounding instructions prepended to rendered prompt messages. |
get_arguments
¶
Return prompt arguments, introspecting from signature if needed.
When arguments was set explicitly, returns that list unchanged.
For standalone prompts, walks inspect.signature(fn).parameters
(which transparently consults fn.__signature__ when present and
otherwise builds from fn.__code__ / fn.__annotations__).
For handler-based prompts, walks the handler's parsed Litestar
signature, filtering out DI dependencies and framework parameters
(request, headers, …) so the advertised shape matches what
an MCP caller is expected to supply.
Both paths enrich each entry with a Google-style docstring description when present.
Handler Service & Request Context¶
MCPHandlerService
¶
Service class encapsulating the MCP JSON-RPC business logic.
run_task_attempt
¶
Execute one task-augmented tool call attempt in a background worker.
server_discover
¶
Describe the modern protocol versions, capabilities, and extensions.
initialize
¶
Negotiate MCP protocol version and return server capabilities and info.
notifications_initialized
¶
Acknowledge an initialized notification.
build_tool_entries
¶
Build the unpaginated list of advertised MCP tool specifications.
tools_list
¶
Return a paginated list of registered MCP tools matching active filters.
tools_call
¶
Invoke a registered MCP tool synchronously or promote it to a background task.
resources_list
¶
Return a paginated list of concrete MCP resources and visible skill files.
resources_templates_list
¶
Return a paginated list of registered RFC 6570 resource URI templates.
resources_read
¶
Read the contents of a concrete resource, skill file, or URI-template resource.
skills_list
¶
List every skill in the catalog, one atomic entry per skill.
resources_directory_read
¶
List the files and subdirectories directly under a skill:// directory URI.
completion_complete
¶
Return argument auto-completion suggestions for prompts or resource templates.
prompts_list
¶
Return a paginated list of registered MCP prompts matching active filters.
prompts_get
¶
Render a registered MCP prompt with caller-supplied string arguments.
tasks_get
¶
Retrieve the current status and result of a background MCP task.
tasks_update
¶
Supply interactive input responses to a task awaiting client input and resume execution.
tasks_cancel
¶
Request cancellation of an in-flight MCP background task.
MCPRequestContext
¶
Request context threaded through tool and task execution.
Authentication lives in Litestar middleware; request.user and
request.auth are the per-request source of truth for tool handlers.
This struct only carries the scope identifiers used by MCP itself
(client id, task-owner id, and the live request handle).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
client_id
|
str
|
Identifier of the connected MCP client or transport session. |
required |
owner_id
|
str | None
|
Authenticated task-owner identifier, or |
required |
request
|
Request[Any, Any, Any] | None
|
Inbound Litestar HTTP |
None
|
protocol_version
|
str
|
Negotiated MCP protocol version string for the current request. |
'2026-07-28'
|
client_capabilities
|
dict[str, Any] | None
|
Client capabilities dictionary advertised during initialization or via request |
None
|
client_info
|
dict[str, Any] | None
|
Client implementation metadata ( |
None
|
input_responses
|
dict[str, Any] | None
|
Multi-round-trip input responses supplied by the client for an interactive tool call. |
None
|
request_state
|
str | None
|
Opaque round-tripped state token accompanying |
None
|
progress_token
|
str | int | None
|
Optional progress correlation token extracted from request |
None
|
progress_reporter
|
Callable[[dict[str, Any]], Awaitable[None]] | None
|
Optional async callback used to emit |
None
|
Attributes:
| Name | Type | Description |
|---|---|---|
client_id | str | Identifier of the connected MCP client or transport session. |
owner_id | str | None | Authenticated task-owner identifier, or |
request | Request[Any, Any, Any] | None | Inbound Litestar HTTP |
protocol_version | str | Negotiated MCP protocol version string for the current request. |
client_capabilities | dict[str, Any] | None | Client capabilities dictionary advertised during initialization or via request |
client_info | dict[str, Any] | None | Client implementation metadata ( |
input_responses | dict[str, Any] | None | Multi-round-trip input responses supplied by the client for an interactive tool call. |
request_state | str | None | Opaque round-tripped state token accompanying |
progress_token | str | int | None | Optional progress correlation token extracted from request |
progress_reporter | Callable[[dict[str, Any]], Awaitable[None]] | None | Optional async callback used to emit |
report_progress
¶
Report progress correlated to the request's supplied progress token.
get_mcp_request_context
¶
Return the context for the currently executing MCP handler.