Test Execute Tool
Tool Registry
Test Execute Tool
POST
Test Execute Tool
Run a tool’s execution body in the sandbox against test inputs. This is what the editor’s Test Run button calls behind the scenes; useful for verifying a body works as expected before promoting the version.Documentation Index
Fetch the complete documentation index at: https://docs.promptlayer.com/llms.txt
Use this file to discover all available pages before exploring further.
Resolving the version
Withoutlabel or version query params, the latest version is used. Pass label=production to test the production version, or version=3 to pin to a specific number.
In-flight overrides
Bothexecution and tool_definition in the body are optional overrides. If you supply them, they take precedence over what’s stored on the version. This lets you test changes without saving a new version first.
Result shape
The endpoint returns200 for both successful runs and user-code errors. Inspect result.status:
"success"→ your body returned a value, available atresult.result"error"→ your body raised, with details underresult.error.message
502. These are operational issues, not your code’s fault.Authorizations
Headers
Path Parameters
Tool ID (numeric) or name
Query Parameters
Resolve version by label name (e.g. production). Falls back to latest if neither label nor version supplied.
Resolve by specific version number
Body
application/json
Arguments passed to the tool body. Same shape the LLM would emit — keys match the tool's parameter names.
In-flight override of the stored execution config. Lets you test unsaved code.
In-flight override of the stored tool definition. Used to test against a different function name without saving.

