Skip to main content
Glama

Send API Request

unfour.api.send_request

Sends 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

NameRequiredDescriptionDefault
urlNoURL for ad-hoc sends.
bodyNoOptional request body for ad-hoc sends.
nameNoOptional display name for ad-hoc request history.
queryNoOptional query parameters as an object or array of {key,value,enabled}.
methodNoHTTP method for ad-hoc sends, such as GET, POST, PUT, PATCH, DELETE.
headersNoOptional headers as an object or array of {key,value,enabled}. Sensitive values are redacted in results.
bodyKindNoOptional body kind for ad-hoc sends (json, text, form, xml). Defaults to json.
requestIdNoReplays one snapshot of the saved request, including its method and scripts. Omit for ad-hoc sends.
timeoutMsNoOptional 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.
workspaceIdNoFor saved replay, a supplied ID must match the request's workspace. Ad-hoc sends default to the workspace active when the call is authorized.
environmentIdNoOptional per-call environment override. It is used for variable resolution and saved request scripts without changing the workspace active environment.

Output Schema

NameRequiredDescriptionDefault
okYes
errorNo
sourceYes
statusNo
headersNo
bodyTypeNo
warningsNo
sizeBytesNo
truncatedNo
durationMsNo
statusTextNo
bodyPreviewNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.15.0
    • changedInput schema / properties / requestId / description
      Previous value: -"Optional saved API request ID to replay. Omit when sending method/url directly."New value: +"Replays one snapshot of the saved request, including its method and scripts. Omit for ad-hoc sends."
    • changedInput schema / properties / workspaceId / description
      Previous value: -"Optional workspace ID for ad-hoc requests. Uses the active workspace if omitted."New value: +"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."
  2. Changed1 schema field changedv0.12.0
    • addedOutput schema / properties / warnings
      Added value: +{
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
  3. Changed1 schema field changedv0.9.6
    • changedInput schema / properties / timeoutMs / description
      Previous value: -"Optional timeout in milliseconds. Omitted or null defaults to 60000ms; 0 means unlimited; positive values are used exactly."New value: +"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."
  4. Changed3 schema fields changedv0.9.3
    • changedInput schema / properties / timeoutMs / description
      Previous value: -"Optional timeout in milliseconds. Maximum 60000ms (60 seconds)."New value: +"Optional timeout in milliseconds. Omitted or null defaults to 60000ms; 0 means unlimited; positive values are used exactly."
    • addedInput schema / properties / timeoutMs / minimum
      Added value: +0
    • changedInput schema / properties / timeoutMs / type
      Previous value: -"number"New value: +[
      +  "integer",
      +  "null"
      +]
  5. Changed1 schema field changedv0.9.1
    • changedInput schema / properties / environmentId / description
      Previous value: -"Optional environment ID (currently uses the workspace default environment)."New value: +"Optional per-call environment override. It is used for variable resolution and saved request scripts without changing the workspace active environment."
  6. First observedv0.1.0

TDQS

A4.5/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Goes well beyond the annotations, which only say non-read-only, open-world, non-idempotent, non-destructive. The description adds the real behavioral surface: per-environment method gating, that non-2xx responses come back as structured status/body data instead of an MCP tool failure, and that sensitive headers, cookies, URL tokens, and JSON body fields are masked.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Four sentences, front-loaded with what the tool does and its two modes, then use case, then environment constraints, then error and masking behavior. Every sentence carries operational information an agent needs, with no filler or restatement of the title.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values need not be explained, and the description covers the remaining high-risk gaps for an open-world multi-parameter tool: environment permission tiers, how HTTP errors surface, and data masking. Nothing material for correct invocation in a production-like environment is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, and the schema itself already documents requestId replay semantics, timeout defaults, and workspace/environment resolution, so the description is not required to carry parameter meaning. What it adds is mode-level framing (saved vs ad-hoc), which is useful but largely duplicated by the requestId and url field descriptions; baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (sends) and resource (an API request) with two clearly named modes: saved replay by requestId or ad-hoc by method/url/headers/query/body. That framing immediately separates it from the sibling CRUD tools such as get_request, create_request, and update_request, which manage definitions rather than execute them.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives an explicit use case ('reproduce API failures during agent troubleshooting') and hard usage constraints by environment tier: dev allows all methods, test flags mutating methods as write risk, prod allows only GET/HEAD/OPTIONS. It stops short of naming alternative tools or stating when not to use it at all, so it is strong but not complete routing guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools