> ## Documentation Index
> Fetch the complete documentation index at: https://kernel.sh/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Invoke a discovered WebMCP tool

> Invokes the exact live registration identified by tool_ref and waits synchronously for its result.
Navigation during execution is allowed. If the tab or embedded frame disappears, or the request
times out after invocation begins, the response reports outcome_unknown and the tool is not retried.




## OpenAPI

````yaml https://api.onkernel.com/spec.json post /browsers/{id_or_name}/webmcp/invoke
openapi: 3.1.0
info:
  description: Developer tools and cloud infrastructure for AI agents to use web browsers
  title: Kernel API
  version: 0.1.0
servers:
  - description: API Server
    url: https://api.onkernel.com
security:
  - bearerAuth: []
tags:
  - description: Create and manage browser sessions.
    name: Browsers
  - description: Control mouse, keyboard, and screen on the browser instance.
    name: Browser Computer Controls
  - description: Execute Playwright code against the browser instance.
    name: Browser Playwright
  - description: Discover and invoke native page tools across the browser instance.
    name: Browser WebMCP
  - description: Read, write, and manage files on the browser instance.
    name: Browser Filesystem
  - description: Execute and manage processes on the browser instance.
    name: Browser Processes
  - description: Record and manage browser session video replays.
    name: Browser Replays
  - description: Stream logs from the browser instance.
    name: Browser Logs
  - description: >-
      Stream live telemetry events from a browser session, and manage the
      destinations sessions export them to.
    name: Browser Telemetry
  - description: Create, list, retrieve, and delete browser profiles.
    name: Profiles
  - description: Create and manage proxy configurations for routing browser traffic.
    name: Proxies
  - description: Create, list, retrieve, and delete browser extensions.
    name: Extensions
  - description: Create and manage browser pools for acquiring and releasing browsers.
    name: Browser Pools
  - description: Inspect the identity and authorization context for the current request.
    name: Authentication
  - description: >-
      Create and manage auth connections for automated credential capture and
      login.
    name: Managed Auth
  - description: Create and manage credentials for authentication.
    name: Credentials
  - description: Configure external credential providers like 1Password.
    name: Credential Providers
  - description: List applications and versions.
    name: Apps
  - description: Create and manage app deployments and stream deployment events.
    name: Deployments
  - description: Invoke actions and stream or query invocation status and events.
    name: Invocations
  - description: Read and manage organization-level limits.
    name: Organization
  - description: |
      Create and manage projects for resource isolation within an organization.
      When projects are disabled for the organization, project operations return
      `404` with code `projects_disabled`.
    name: Projects
  - description: Create and manage API keys for organization and project-scoped access.
    name: API Keys
  - description: Read audit log records for the authenticated organization.
    name: Audit Logs
  - description: Resolve browser and proxy recommendations for bot-protected sites.
    name: Config Registry
paths:
  /browsers/{id_or_name}/webmcp/invoke:
    post:
      tags:
        - Browser WebMCP
      summary: Invoke a discovered WebMCP tool
      description: >
        Invokes the exact live registration identified by tool_ref and waits
        synchronously for its result.

        Navigation during execution is allowed. If the tab or embedded frame
        disappears, or the request

        times out after invocation begins, the response reports outcome_unknown
        and the tool is not retried.
      operationId: invokeWebMCPTool
      parameters:
        - description: Browser session ID or name
          example: htzv5orfit78e1m2biiifpbv
          in: path
          name: id_or_name
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebMCPInvokeRequest'
        description: >-
          The raw JSON request body is limited to 1 MiB plus 4 KiB of envelope
          overhead before decoding.
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebMCPInvocationResult'
          description: The tool's terminal result
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalError'
        '504':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebMCPInvocationFailure'
          description: Invocation began, but its final outcome could not be observed
        default:
          $ref: '#/components/responses/BrowserProxyError'
      security:
        - bearerAuth: []
components:
  schemas:
    WebMCPInvokeRequest:
      additionalProperties: false
      properties:
        input:
          additionalProperties: true
          description: Tool input, limited to 1 MiB after JSON serialization.
          type: object
        timeout_sec:
          default: 60
          maximum: 120
          minimum: 1
          type: integer
        tool_ref:
          maxLength: 128
          minLength: 1
          type: string
      required:
        - tool_ref
        - input
      type: object
    WebMCPInvocationResult:
      additionalProperties: false
      properties:
        error_text:
          type: string
        invocation_id:
          type: string
        output:
          description: >-
            Untrusted page-provided output. Callers must treat it as potentially
            malicious input.
        status:
          enum:
            - completed
            - canceled
            - error
          type: string
      required:
        - invocation_id
        - status
      type: object
    WebMCPInvocationFailure:
      additionalProperties: false
      properties:
        code:
          enum:
            - outcome_unknown
          type: string
        invocation_id:
          type: string
        message:
          type: string
      required:
        - code
        - message
      type: object
    Error:
      properties:
        code:
          description: Application-specific error code (machine-readable)
          example: bad_request
          type: string
        details:
          description: Additional error details (for multiple errors)
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type: array
        inner_error:
          $ref: '#/components/schemas/ErrorDetail'
        message:
          description: Human-readable error description for debugging
          example: 'Missing required field: app_name'
          type: string
      required:
        - code
        - message
      type: object
    InstanceProxyError:
      properties:
        code:
          $ref: '#/components/schemas/InstanceProxyErrorCode'
        message:
          description: Human-readable error description for debugging
          type: string
      required:
        - code
        - message
      type: object
    ErrorDetail:
      properties:
        code:
          description: Lower-level error code providing more specific detail
          example: invalid_input
          type: string
        message:
          description: Further detail about the error
          example: Provided version string is not semver compliant
          type: string
      type: object
    InstanceProxyErrorCode:
      description: Canonical error code returned by browser instance API proxy routes
      enum:
        - invalid_request
        - unauthorized
        - forbidden
        - session_not_leased
        - not_found
        - conflict
        - session_gone
        - rate_limit_exceeded
        - internal_error
        - browser_unavailable
      type: string
  responses:
    BadRequest:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      description: Bad Request – invalid input
    NotFound:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      description: Resource not found
    InternalError:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      description: Internal Server Error
    BrowserProxyError:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/InstanceProxyError'
      description: Error returned by the browser or its proxy
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````