---
title: "Test Execute Tool"
method: POST
path: "/api/public/v2/tool-registry/{identifier}/test-execute"
tags: ["tool-registry"]
---

# Test Execute Tool

`POST /api/public/v2/tool-registry/{identifier}/test-execute`

## Path parameters

- `identifier` string, required — Tool ID (numeric) or name

## Query parameters

- `label` string — Resolve version by label name (e.g. production). Falls back to latest if neither label nor version supplied.
- `version` string — Resolve by specific version number

## Headers

- `X-API-KEY` string, required

## Request body

- object
  - `inputs` object — Arguments passed to the tool body. Same shape the LLM would emit — keys match the tool's parameter names.
  - `execution` object, nullable — In-flight override of the stored execution config. Lets you test unsaved code.
    - `type` 'code', required
    - `language` 'python' | 'javascript', required
    - `code` string, required
  - `tool_definition` object, nullable — In-flight override of the stored tool definition. Used to test against a different function name without saving.

## Response `200`

Tool executed (success or user-code error). User-code errors return status="error" inside the result object — they do NOT raise.

- object
  - `success` boolean
  - `message` string
  - `result` object
    - `status` 'success' | 'error'
    - `result` unknown
    - `stdout` string
    - `stderr` string
    - `duration_ms` integer
    - `error` object, nullable — Present on status="error". Includes `type` and `message`.

## Other responses

- `400` — Missing execution config or function name
- `404` — Tool or version not found
- `502` — Sandbox infrastructure failure

---

[API](https://skmtc.dev/promptlayer/apis/promptlayer-api.md) · [All operations](https://skmtc.dev/promptlayer/apis/promptlayer-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/promptlayer/promptlayer-api/revisions/a23093a0a506/schema)
