---
title: "Test a tool"
method: POST
path: "/v1/{organization}/tool/test"
tags: ["Tool"]
---

# Test a tool

`POST /v1/{organization}/tool/test`

## Path parameters

- `organization` string, required

## Headers

- `x-mongo-cluster-name` string, nullable — The Mongo cluster name to perform this request in. This is usually not needed unless the organization does not exist yet in the Amigo organization infra config database.
- `Sec-WebSocket-Protocol` string[]

## Request body

- SrcAppEndpointsToolTestToolRequest
  - `inputs` Input[], required — The list of inputs for the tool invocation.
    - `input_parameters` object, required — The input parameters for the tool invocation.
    - `invocation_mode` 'regular' | 'conversation-simulation', required — The mode of invocation.
    - `nonsensitive_user_variables` object, required — The nonsensitive user variables to provide to the tool during invocation.
    - `sensitive_user_variables` object, required — The sensitive user variables to provide to the tool during invocation.
  - `commit_branch` string, required — The branch in the tools repo whose tip will be tested.
  - `project_path` string, required — The directory in the tools repo that contains the `pyproject.toml` file corresponding to the tool version to publish.
  - `required_envvars` object, required — The environment variables required for the tool to run.
  - `required_secret_envvars` object, required — The secret environment variables required for the tool to run.

## Response `200`

Succeeded

- SrcAppEndpointsToolTestToolResponse
  - `invocation_results` InvocationResult[], required
    - union
      - SucceededInvocationResult
        - `succeeded` true
        - `output` string, required — The output of the tool invocation.
        - `duration_ms` integer, required — The duration of the tool invocation in milliseconds.
      - FailedInvocationResult
        - `succeeded` false
        - `exception_message` string, required — The message of the exception during the tool invocation.
        - `exception_type` string, required — The type of the exception during the tool invocation.
        - `exception_stack_trace` string[], required — The stack trace of the exception during the tool invocation.
        - `duration_ms` integer, required — The duration of the tool invocation in milliseconds.

## Other responses

- `400` — This error can occur due to the following reasons: * An environment variable is specified as both secret and non-secret. * The specified tool commit failed CI checks. * Required environment variables in the tool are not declared in the reqeust. * Input parameters do not conform to the tool's input schema. * Tool build failed.
- `401` — Invalid authorization credentials.
- `403` — Missing required permissions.
- `404` — The specified organization or tool commit does not exist.
- `422` — Invalid request path parameter or request body failed validation.
- `429` — The user has exceeded the rate limit of 1 request per minute for this endpoint.
- `503` — The service is going through temporary maintenance.

---

[API](https://skmtc.net/amigo/apis/amigo-api.md) · [All operations](https://skmtc.net/amigo/apis/amigo-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/amigo/amigo-api/revisions/f0f28319e448/schema)
