ExperimentalZod schema type for input validation (default: any Zod type)
MCP Tasks is an experimental SDK feature
Optional Readonly Experimental_Optional metadata passed through to the MCP SDK.
Optional Readonly ExperimentalannotationsOptional annotations providing hints about tool behavior.
Readonly ExperimentaldescriptionHuman-readable description shown to LLM
Readonly ExperimentalinputZod schema for input validation
Readonly ExperimentalnameUnique tool name (e.g., 'long_computation')
Optional Readonly ExperimentalrequiredScopes required to execute this task tool (RBAC).
When set, the framework checks authInfo.scopes BEFORE
the task handler executes. All listed scopes must be present (AND logic).
If the check fails, a 403 Forbidden error is returned.
Omit or set to undefined for task tools accessible to any authenticated user.
Readonly ExperimentaltaskTask handler with create/get/getResult methods.
These three methods implement the task lifecycle:
createTask — Start the background workgetTask — Report current statusgetTaskResult — Return the final resultOptional Readonly ExperimentaltaskTask support level.
'optional' — Tool can be called normally or as a task'required' — Tool MUST be called as a task
Task tool definition — a tool with asynchronous task execution support.
Task tools enable long-running operations that report progress asynchronously. Instead of blocking the tool call until completion, the client receives a task ID and can poll for status updates and results.
Registered via
defineTask()which auto-registers inglobalTaskToolRegistry. The framework uses the SDK'sexperimental.tasks.registerToolTask()internally.Example