Send API Request
unfour.api.send_requestSends saved or ad-hoc API requests via Unfour to reproduce API failures during agent troubleshooting, with environment-aware access controls and masked sensitive data.
Instructions
Sends either a saved API request by requestId or one ad-hoc request described by method/url/headers/query/body through the Unfour command bus. Use it to reproduce API failures during agent troubleshooting. Dev allows all HTTP methods; test allows sends but marks mutating methods as write risk; prod only allows GET/HEAD/OPTIONS. Non-2xx HTTP responses return structured status/body data rather than MCP tool failure. Sensitive headers, cookies, URL tokens, and JSON body fields are masked.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "unfour.api.send_request"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | URL for ad-hoc sends. | |
| body | No | Optional request body for ad-hoc sends. | |
| name | No | Optional display name for ad-hoc request history. | |
| query | No | Optional query parameters as an object or array of {key,value,enabled}. | |
| method | No | HTTP method for ad-hoc sends, such as GET, POST, PUT, PATCH, DELETE. | |
| headers | No | Optional headers as an object or array of {key,value,enabled}. Sensitive values are redacted in results. | |
| bodyKind | No | Optional body kind for ad-hoc sends (json, text, form, xml). Defaults to json. | |
| requestId | No | Replays one snapshot of the saved request, including its method and scripts. Omit for ad-hoc sends. | |
| timeoutMs | No | Optional timeout in milliseconds. Omitted or null defaults to 60000ms. 0 disables the HTTP timeout; positive values are passed through to the HTTP layer. All MCP calls remain subject to the independent 120-second MCP safety deadline. | |
| workspaceId | No | For saved replay, a supplied ID must match the request's workspace. Ad-hoc sends default to the workspace active when the call is authorized. | |
| environmentId | No | Optional per-call environment override. It is used for variable resolution and saved request scripts without changing the workspace active environment. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| error | No | ||
| source | Yes | ||
| status | No | ||
| headers | No | ||
| bodyType | No | ||
| warnings | No | ||
| sizeBytes | No | ||
| truncated | No | ||
| durationMs | No | ||
| statusText | No | ||
| bodyPreview | No |