Skip to main content
Every tool handler receives a PluginContext as its first argument. It provides authentication, authorization context, approval requests, and logging.

Properties

ctx.userId

The authenticated user’s ID. Use this to scope operations to the current user.

ctx.role

The user’s role, including the glob patterns that determine which tools they can access.

ctx.auth

Retrieve an OAuth access token for a provider. The token is automatically vended and refreshed by the server.

ctx.elicit

Request user approval before performing a destructive action. See Elicitation Guide.

ctx.logger

Structured logging with optional metadata.