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

# List or call WebMCP tools

> With `action: "list"`, lists the environment's MCP tools. With `action: "call"`, calls one of them. Used by AI agents browsing a page that has the chat widget.



## OpenAPI

````yaml /api-reference/openapi.json post /api/mcp/chat/webmcp
openapi: 3.1.0
info:
  title: Waniwani API
  version: 1.0.0
  description: >-
    The HTTP routes the Waniwani SDK and chat widget call. Use them from any
    language. Server routes take a secret `wwk_` API key; chat routes take a
    channel's `wwp_` public key, which is meant to ship in a web page.
servers:
  - url: https://app.waniwani.ai
    description: US region
  - url: https://eu.app.waniwani.ai
    description: EU region
security: []
tags:
  - name: Server API
    description: Called from your server with a secret `wwk_` API key.
  - name: Chat API
    description: Called from a web page with a channel's `wwp_` public key.
paths:
  /api/mcp/chat/webmcp:
    post:
      tags:
        - Chat API
      summary: List or call WebMCP tools
      description: >-
        With `action: "list"`, lists the environment's MCP tools. With `action:
        "call"`, calls one of them. Used by AI agents browsing a page that has
        the chat widget.
      operationId: webmcpChat
      requestBody:
        content:
          application/json:
            schema:
              oneOf:
                - type: object
                  properties:
                    sessionId:
                      type: string
                      minLength: 1
                    visitorId:
                      type: string
                    channelId:
                      type: string
                    page:
                      type: object
                      properties:
                        url:
                          type: string
                        title:
                          type: string
                    action:
                      type: string
                      enum:
                        - list
                  required:
                    - sessionId
                    - action
                - type: object
                  properties:
                    sessionId:
                      type: string
                      minLength: 1
                    visitorId:
                      type: string
                    channelId:
                      type: string
                    page:
                      type: object
                      properties:
                        url:
                          type: string
                        title:
                          type: string
                    action:
                      type: string
                      enum:
                        - call
                    name:
                      type: string
                      minLength: 1
                    arguments:
                      type: object
                      additionalProperties: {}
                      default: {}
                  required:
                    - sessionId
                    - action
                    - name
      responses:
        '200':
          description: '200'
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    properties:
                      tools:
                        type: array
                        items:
                          type: object
                          properties:
                            name:
                              type: string
                            description:
                              type: string
                            inputSchema:
                              type: object
                              additionalProperties: {}
                              description: JSON Schema of the tool's arguments.
                            annotations:
                              type: object
                              additionalProperties: {}
                          required:
                            - name
                            - description
                    required:
                      - tools
                  - type: object
                    properties:
                      content:
                        type: array
                        items:
                          type: object
                          properties:
                            type:
                              type: string
                            text:
                              type: string
                          required:
                            - type
                          additionalProperties: {}
                          description: >-
                            One MCP content block. `type` names the block; the
                            other keys depend on it.
                      structuredContent:
                        type: object
                        additionalProperties: {}
                      isError:
                        type: boolean
                      _meta:
                        type: object
                        additionalProperties: {}
                      widget:
                        type:
                          - object
                          - 'null'
                        properties:
                          viewUri:
                            type: string
                            description: The `ui://` URI the widget's view resolves from.
                          tool:
                            type: string
                            description: The display tool the view belongs to.
                          data:
                            type: object
                            additionalProperties: {}
                            description: The view's props.
                          result:
                            type: object
                            properties:
                              content:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    type:
                                      type: string
                                    text:
                                      type: string
                                  required:
                                    - type
                                  additionalProperties: {}
                                  description: >-
                                    One MCP content block. `type` names the
                                    block; the other keys depend on it.
                              structuredContent:
                                type: object
                                additionalProperties: {}
                              _meta:
                                type: object
                                additionalProperties: {}
                            required:
                              - content
                          interactive:
                            type: boolean
                            description: >-
                              Whether the flow waits on the visitor before it
                              goes on.
                          preview:
                            type: boolean
                        required:
                          - viewUri
                          - tool
                          - data
                          - result
                          - interactive
                        description: '`null` unless the call produced a widget step.'
                    required:
                      - content
                      - widget
      security:
        - publicKeyAuth: []
components:
  securitySchemes:
    publicKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: WaniwaniPublicKey
      description: >-
        Waniwani public key passed as `Authorization: Bearer wwp_<key>`. A
        channel's public key is meant to ship in a web page.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.