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

# Test tool

> Run a tool with the parameters you supply and return what it answered.

The call is synchronous: the response carries the tool's status, body, and duration, so a green result is evidence the tool ran rather than evidence it was accepted. Each run is also recorded and readable afterwards via `GET /v1/senders/{senderId}/agent/tools/{toolId}/test-runs`.

A tool that answers with an error is reported as a run with `success: false` — the endpoint itself still returns 200. This fires the tool's real webhook, so a test has whatever side effects the tool has.



## OpenAPI

````yaml /openapi.json post /v1/senders/{senderId}/agent/tools/{toolId}/test
openapi: 3.0.3
info:
  title: Zavu Unified Messaging Layer API
  version: 0.2.0
  description: >
    Unified multi-channel messaging API for Zavu.


    Supported channels:

    - **SMS**: Simple text messages

    - **WhatsApp**: Rich messaging with media, buttons, lists, CTA URL buttons,
    location requests, and templates

    - **Telegram**: Bot messaging with text, media, and interactive elements

    - **Email**: Transactional emails via Amazon SES


    Design goals:

    - Simple `send()` entrypoint for developers

    - Project-level authentication via Bearer token

    - Support for all WhatsApp message types (text, image, video, audio,
    document, sticker, location, contact, buttons, list, cta_url,
    location_request, reaction, template)

    - If a non-text message type is sent, WhatsApp channel is used automatically

    - 24-hour WhatsApp conversation window enforcement

    - Universal `to` field accepts phone numbers (E.164), email addresses, or
    numeric chat IDs (Telegram/Instagram/Messenger)
servers:
  - url: https://api.zavu.dev
security:
  - bearerAuth: []
paths:
  /v1/senders/{senderId}/agent/tools/{toolId}/test:
    post:
      tags:
        - Agent Tools
      summary: Test tool
      description: >-
        Run a tool with the parameters you supply and return what it answered.


        The call is synchronous: the response carries the tool's status, body,
        and duration, so a green result is evidence the tool ran rather than
        evidence it was accepted. Each run is also recorded and readable
        afterwards via `GET
        /v1/senders/{senderId}/agent/tools/{toolId}/test-runs`.


        A tool that answers with an error is reported as a run with `success:
        false` — the endpoint itself still returns 200. This fires the tool's
        real webhook, so a test has whatever side effects the tool has.
      operationId: testAgentTool
      parameters:
        - $ref: '#/components/parameters/SenderIdParam'
        - $ref: '#/components/parameters/ToolIdParam'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ToolTestRequest'
            example:
              testParams:
                order_id: ORD-12345
      responses:
        '200':
          description: The tool ran. Check `run.success` for what it answered.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ToolTestResponse'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Tool not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  parameters:
    SenderIdParam:
      name: senderId
      in: path
      required: true
      schema:
        type: string
    ToolIdParam:
      name: toolId
      in: path
      required: true
      schema:
        type: string
  schemas:
    ToolTestRequest:
      type: object
      required:
        - testParams
      properties:
        testParams:
          type: object
          description: Parameters to pass to the tool for testing.
          additionalProperties: true
    ToolTestResponse:
      type: object
      required:
        - run
      properties:
        run:
          $ref: '#/components/schemas/AgentToolTestRun'
    Error:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          example: invalid_request
        message:
          type: string
          example: Phone number is invalid
        details:
          type: object
          additionalProperties: true
    AgentToolTestRun:
      type: object
      description: >-
        One run of a tool triggered from the test endpoint. Recorded so a test
        is verifiable after the fact rather than only visible in the response.
      required:
        - id
        - toolId
        - success
        - durationMs
        - createdAt
      properties:
        id:
          type: string
        toolId:
          type: string
        params:
          type: object
          additionalProperties: true
          description: The parameters the tool was called with.
        success:
          type: boolean
          description: >-
            Whether the tool returned without error. A tool that answered with a
            non-2xx status is a failed run, not an error of this endpoint.
        statusCode:
          type: integer
          nullable: true
          description: >-
            HTTP status the tool's webhook returned. Absent for tools that do
            not go over HTTP.
        response:
          type: string
          nullable: true
          description: The tool's response body, truncated.
        error:
          type: string
          nullable: true
          description: Why the run failed, when it did.
        durationMs:
          type: integer
        createdAt:
          type: string
          format: date-time
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

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