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

# Test Assistant Tool

> Test a webhook tool for an assistant



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/ai/assistants.yml post /ai/assistants/{assistant_id}/tools/{tool_id}/test
openapi: 3.1.0
info:
  title: Telnyx AI Assistants API
  version: 2.0.0
  description: >-
    API for managing AI Assistants, including CRUD fields, versions, tags,
    integrations, MCP servers, and shared tools.
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
security:
  - bearerAuth: []
paths:
  /ai/assistants/{assistant_id}/tools/{tool_id}/test:
    post:
      tags:
        - Assistants
      summary: Test Assistant Tool
      description: Test a webhook tool for an assistant
      operationId: >-
        test_assistant_tool_public_assistants__assistant_id__tools__tool_id__test_post
      parameters:
        - name: assistant_id
          in: path
          required: true
          schema:
            type: string
            title: Assistant Id
        - name: tool_id
          in: path
          required: true
          schema:
            type: string
            title: Tool Id
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TestWebhookToolRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TestWebhookToolResponseData'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Telnyx from 'telnyx';


            const client = new Telnyx({
              apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
            });


            const response = await client.ai.assistants.tools.test('tool_id', {
            assistant_id: 'assistant_id' });


            console.log(response.data);
        - lang: Python
          source: |-
            import os
            from telnyx import Telnyx

            client = Telnyx(
                api_key=os.environ.get("TELNYX_API_KEY"),  # This is the default and can be omitted
            )
            response = client.ai.assistants.tools.test(
                tool_id="tool_id",
                assistant_id="assistant_id",
            )
            print(response.data)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/team-telnyx/telnyx-go\"\n\t\"github.com/team-telnyx/telnyx-go/option\"\n)\n\nfunc main() {\n\tclient := telnyx.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.AI.Assistants.Tools.Test(\n\t\tcontext.TODO(),\n\t\t\"tool_id\",\n\t\ttelnyx.AIAssistantToolTestParams{\n\t\t\tAssistantID: \"assistant_id\",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.Data)\n}\n"
        - lang: Java
          source: |-
            package com.telnyx.sdk.example;

            import com.telnyx.sdk.client.TelnyxClient;
            import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
            import com.telnyx.sdk.models.ai.assistants.tools.ToolTestParams;
            import com.telnyx.sdk.models.ai.assistants.tools.ToolTestResponse;

            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    TelnyxClient client = TelnyxOkHttpClient.fromEnv();

                    ToolTestParams params = ToolTestParams.builder()
                        .assistantId("assistant_id")
                        .toolId("tool_id")
                        .build();
                    ToolTestResponse response = client.ai().assistants().tools().test(params);
                }
            }
        - lang: Ruby
          source: >-
            require "telnyx"


            telnyx = Telnyx::Client.new(api_key: "My API Key")


            response = telnyx.ai.assistants.tools.test_("tool_id", assistant_id:
            "assistant_id")


            puts(response)
        - lang: PHP
          source: >-
            <?php


            require_once dirname(__DIR__) . '/vendor/autoload.php';


            use Telnyx\Client;

            use Telnyx\Core\Exceptions\APIException;


            $client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API
            Key');


            try {
              $response = $client->ai->assistants->tools->test(
                'tool_id',
                assistantID: 'assistant_id',
                arguments: ['foo' => 'bar'],
                dynamicVariables: ['foo' => 'bar'],
              );

              var_dump($response);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx ai:assistants:tools test \
              --api-key 'My API Key' \
              --assistant-id assistant_id \
              --tool-id tool_id
components:
  schemas:
    TestWebhookToolRequest:
      properties:
        arguments:
          type: object
          title: Arguments
          description: Key-value arguments to use for the webhook test
          additionalProperties: true
        dynamic_variables:
          type: object
          title: Dynamic Variables
          description: Key-value dynamic variables to use for the webhook test
          additionalProperties: true
      type: object
      title: TestWebhookToolRequest
      description: Request model for testing a webhook tool
    TestWebhookToolResponseData:
      properties:
        data:
          $ref: '#/components/schemas/TestWebhookToolResponse'
      type: object
      required:
        - data
      title: TestWebhookToolResponseData
      description: Response model for webhook tool test results
    HTTPValidationError:
      title: HTTPValidationError
      type: object
      properties:
        detail:
          title: Detail
          type: array
          items:
            $ref: '#/components/schemas/ValidationError'
    TestWebhookToolResponse:
      properties:
        success:
          type: boolean
          title: Success
        status_code:
          type: integer
          title: Status Code
        content_type:
          type: string
          title: Content Type
        response:
          type: string
          title: Response
        request:
          type: object
          title: Request
          additionalProperties: true
      type: object
      required:
        - success
        - status_code
        - content_type
        - response
        - request
      title: TestWebhookToolResponse
      description: Response model for webhook tool test results
    ValidationError:
      title: ValidationError
      required:
        - loc
        - msg
        - type
      type: object
      properties:
        loc:
          title: Location
          type: array
          items:
            anyOf:
              - type: string
              - type: integer
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````