---
title: "Invoke a tool version"
method: POST
path: "/v1/{organization}/tool/{tool_id}/version/{version}/invoke"
tags: ["Tool"]
---

# Invoke a tool version

`POST /v1/{organization}/tool/{tool_id}/version/{version}/invoke`

Invoke a specified tool version with the given input parameters.

#### Permissions
This endpoint requires the following permissions:
* `Tool:InvokeTool` for the tool to invoke.

## Path parameters

- `organization` string, required
- `tool_id` string, required — The ID of the tool to invoke
- `version` string, required — The version of the tool to invoke

## 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

- SrcAppEndpointsToolInvokeToolVersionRequest
  - `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.

## Response `200`

Succeeded

- SrcAppEndpointsToolInvokeToolVersionResponse
  - `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` — The input parameters do not conform to the tool's input schema.
- `401` — Invalid authorization credentials.
- `403` — Missing required permissions.
- `404` — The specified organization, tool, or tool version does not exist.
- `422` — Invalid request path parameter or request body failed validation.
- `429` — The user has exceeded the rate limit of 10 requests 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)
