Skip to main content

Test Tool Action

Used to test a specific tool action. This executes the action with provided parameters and returns detailed results including execution time, request/response details, and any errors.

API Endpoint

PropertyValue
Request MethodPOST
Request URLhttps://api.seliseblocks.com/tools/{tool_id}/test-action/{action_id}

Request

Request Example

curl -X POST 'https://api.seliseblocks.com/tools/{tool_id}/test-action/{action_id}' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"parameters": {
"customer_id": "12345",
"include_orders": true
},
"test_config": {
"timeout_override": 60,
"skip_validation": false
},
"extraction_only": false,
"project_key": "YOUR_PROJECT_KEY"
}'

Path Parameters

FieldTypeRequiredDescription
tool_idstringYesThe unique identifier of the tool.
action_idstringYesThe unique identifier of the action to test.

Request Headers

FieldTypeRequiredDescription
acceptstringYesAccepted response format. Use application/json
Content-Typeapplication/jsonYesData type, must be application/json.

Request Body

Request Body Schema

{
"parameters": {
"additionalProp1": {}
},
"test_config": {
"additionalProp1": {}
},
"extraction_only": false,
"project_key": "string"
}

Request Body Parameters

FieldTypeRequiredDescription
parametersobjectYesDictionary of input parameters for the action (based on action's InputParameters definition).
test_configobjectNoOptional test-specific configuration overrides.
extraction_onlybooleanNoIf true, only test parameter extraction without executing the action (default: false).
project_keystringYesThe project key for your project.

Test Configuration Options

FieldTypeDescription
timeout_overrideintegerOverride the default action timeout in seconds.
skip_validationbooleanSkip input parameter validation (for testing edge cases).
mock_responseobjectProvide a mock response instead of calling the actual endpoint.
debug_modebooleanEnable verbose logging for debugging.
note

Action Testing Details

  • The test executes the action in the same way it would be executed by an AI agent
  • Authentication credentials configured for the tool are used
  • Rate limiting may apply depending on tool configuration
  • The test counts toward tool usage metrics
  • Sensitive data in responses may be partially masked for security
tip

Best practices for testing actions:

  • Start with simple parameter values to verify basic functionality
  • Test with edge cases and boundary values
  • Verify error handling with invalid parameters
  • Check response time for performance issues
  • Test authentication by using the actual tool credentials
  • Use extraction_only mode to test parameter extraction logic first
  • Test with production-like data when possible

The test results help you:

  • Validate action configuration is correct
  • Verify parameter definitions and types
  • Confirm authentication is working
  • Check response parsing and extraction
  • Identify performance bottlenecks
  • Debug integration issues
  • Ensure error handling works as expected

Response

Success Response (200 OK)

Returns detailed test execution results.

{
"success": true,
"result": "{\"customer_id\": \"12345\", \"name\": \"John Doe\", \"email\": \"john@example.com\", \"orders\": []}",
"error": null,
"execution_time": 342,
"request_details": {
"method": "GET",
"url": "https://api.example.com/v1/customers/12345",
"headers": {
"Authorization": "Bearer ***masked***",
"Content-Type": "application/json"
},
"query_params": {
"include_orders": "true"
},
"body": null
},
"response_details": {
"status_code": 200,
"headers": {
"content-type": "application/json",
"content-length": "245"
},
"body": "{\"customer_id\": \"12345\", \"name\": \"John Doe\", \"email\": \"john@example.com\", \"orders\": []}",
"extracted_data": {
"customer_id": "12345",
"name": "John Doe",
"email": "john@example.com"
}
},
"timestamp": "2026-01-12T07:45:11.899Z",
"project_key": "YOUR_PROJECT_KEY"
}

Response Fields

FieldTypeDescription
successbooleanIndicates whether the action executed successfully.
resultstringThe result of the action execution (may be JSON string or text).
errorstringError message if the action failed (null if successful).
execution_timeintegerExecution time in milliseconds.
request_detailsobjectDetails about the HTTP request made.
response_detailsobjectDetails about the HTTP response received.
timestampstringISO 8601 timestamp when the test was executed.
project_keystringThe project key used for the test.

Request Details Fields

FieldTypeDescription
methodstringHTTP method used (GET, POST, PUT, DELETE, PATCH).
urlstringComplete URL that was called.
headersobjectHTTP headers sent (sensitive data masked).
query_paramsobjectQuery parameters included in the request.
bodystringRequest body (if applicable).

Response Details Fields

FieldTypeDescription
status_codeintegerHTTP status code received.
headersobjectResponse headers received.
bodystringResponse body received.
extracted_dataobjectData extracted based on OutputParametersExtraction rules (if configured).

Failed Test Response

Returns error details when the action test fails.

{
"success": false,
"result": null,
"error": "Connection timeout after 30 seconds",
"execution_time": 30000,
"request_details": {
"method": "GET",
"url": "https://api.example.com/v1/customers/12345",
"headers": {
"Authorization": "Bearer ***masked***"
}
},
"response_details": null,
"timestamp": "2026-01-12T07:45:11.899Z",
"project_key": "YOUR_PROJECT_KEY"
}

Error Response (422 Unprocessable Entity)

Returns validation error details when the request parameters are invalid.

{
"detail": [
{
"loc": [
"body",
"parameters",
"customer_id"
],
"msg": "field required",
"type": "value_error.missing"
}
]
}

Error Response Fields

FieldTypeDescription
detailarrayArray of validation error objects.
locarrayLocation of the error in the request (e.g., body field).
msgstringHuman-readable error message.
typestringError type identifier.

Common Test Scenarios

ScenarioDescriptionExpected Result
Valid ParametersAll required parameters provided correctlysuccess: true, valid result
Missing ParametersRequired parameters not providedValidation error (422)
Invalid AuthenticationAuthentication credentials are incorrectsuccess: false, authentication error
TimeoutAction takes longer than timeout limitsuccess: false, timeout error
Invalid ResponseAPI returns unexpected formatsuccess: false, parsing error
Rate LimitedToo many requests in short timesuccess: false, rate limit error

Error Codes

Status CodeDescriptionResponse Type
200Test Completed - Check success field for resultSuccess
400Bad Request - Invalid test parametersBad Request
404Not Found - Tool or action does not existNot Found
422Validation Error - Invalid request parametersUnprocessable Entity
500Internal Server Error - Test execution failedInternal Server Error