create_api_test
Define an API test — a scheduled test of a production HTTP endpoint or MCP server: request + assertions (status/latency/headers/body or MCP tier) executed on an interval, tracking uptime and correctness. Use this to start watching an HTTP endpoint or an MCP server. Set type="HTTP" and the httpTarget/statusPattern params for a web endpoint, or type="MCP" and the mcpTarget params for an MCP server. The URL, headers, body and MCP tool arguments accept Postman-style variables that are resolved once per run: {{uuid}}, {{now}} (ISO 8601 UTC), {{date}}, {{timestamp}} (Unix seconds), {{timestampMs}}, {{timestampNs}}, {{randomInt}} (0-1000) and {{traceId}} (the run's W3C trace id, also sent as the traceparent header). Unknown names are left as written; write {{ for a literal {{. Returns the created API test, including its generated id and current state.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Human-readable name for the API test, e.g. 'checkout API health' | |
| type | Yes | API test type: 'HTTP' for a web endpoint, 'MCP' for an MCP server | |
| mcpUrl | No | MCP only: the MCP server URL to probe | |
| enabled | Yes | Whether the API test starts enabled (scheduled) or paused | |
| httpUrl | No | HTTP only: the http(s) URL to probe. Supports {{uuid}}, {{now}}, {{date}}, {{timestamp}}, {{timestampMs}}, {{timestampNs}}, {{randomInt}} and {{traceId}} variables, resolved once per run; write \{{ for a literal {{. | |
| mcpTier | No | MCP only: assertion depth — HANDSHAKE (just connect), TOOLS_LIST (check expectedTools are advertised) or TOOL_CALL (invoke a tool) | |
| retries | Yes | Retries per run before recording a failure (0-5) | |
| httpBody | No | HTTP only: request body to send; takes the same variables as the URL | |
| toolName | No | MCP TOOL_CALL tier: name of the tool to invoke | |
| httpMethod | No | HTTP only: request method — GET, POST, PUT, PATCH, DELETE or HEAD | |
| httpHeaders | No | HTTP only: request headers to send, as a name->value map; values take the same variables as the URL | |
| expectedTools | No | MCP TOOLS_LIST tier: tool names the server must advertise | |
| statusPattern | No | HTTP only: expected status matcher — 3 chars, digits or 'x' wildcards. '200' matches exactly 200; '2xx' matches any 2xx; '20x' matches 200-209 | |
| headerMatchers | No | HTTP only: response headers that must match, as a name->value map | |
| timeoutSeconds | Yes | Per-run timeout in seconds; must be positive and not exceed intervalSeconds | |
| intervalSeconds | Yes | How often to run the API test, in seconds (minimum 30) | |
| mcpCredentialId | No | MCP only: id of a stored credential to authenticate the MCP session | |
| failureThreshold | Yes | Consecutive failing runs before the API test flips to DOWN (1-10) | |
| httpCredentialId | No | HTTP only: id of a stored credential to authenticate the request (from list_api_test_credentials); omit for an unauthenticated call | |
| maxLatencyMillis | No | HTTP only: fail if response takes longer than this many milliseconds | |
| toolArgumentsJson | No | MCP TOOL_CALL tier: JSON object of arguments to pass to the tool. Supports {{uuid}}, {{now}}, {{date}}, {{timestamp}}, {{timestampMs}}, {{timestampNs}}, {{randomInt}} and {{traceId}} variables, resolved once per run; write \{{ for a literal {{. | |
| bodyValidationTier | No | HTTP only: body validation tier — NONE, VALID_JSON, JSON_SHAPE or EXACT_MATCH | |
| mcpMaxLatencyMillis | No | MCP only: fail if the API test takes longer than this many milliseconds | |
| bodyValidationSample | No | HTTP only: sample body for JSON_SHAPE (a shape template) or EXACT_MATCH tiers | |
| mcpResultValidationTier | No | MCP TOOL_CALL tier: result body validation tier — NONE, VALID_JSON, JSON_SHAPE or EXACT_MATCH | |
| mcpResultValidationSample | No | MCP TOOL_CALL tier: sample result for JSON_SHAPE/EXACT_MATCH validation |