Skip to main content
Glama

ACTION_HTTP_REQUEST

Send HTTP requests from automation workflows to call APIs and store response, status, and success in variables for conditional logic or error handling.

Instructions

发送 HTTP 请求,响应体存入变量(需网络)。输出:http_success, http_error, http_status_code, http_response, http_truncated。headers / body 要写成字符串(JSON 转义成字符串);写成嵌套 JSON 对象会被转成 {k=v} 文本而失效。请求失败不抛错:看 http_success(状态码 200–399 为 true),要按节点出错处理可加 require=http_success。对不稳定的第三方服务设合理 timeout(失败默认跳过继续)。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。

Input Schema

NameRequiredDescriptionDefault
urlYes请求 URL,支持 ${var}
bodyNo请求体字符串,支持 ${var};只在 POST/PUT/PATCH 发送,未设 Content-Type 时按 application/json
methodNoGET / POST / PUT / DELETE / PATCH 等(PATCH 以 POST + X-HTTP-Method-Override 发送)(默认 GET)
headersNo请求头字符串:JSON 对象字符串(如 {"Authorization":"Bearer x"})或 Key:Value;Key2:Value2,支持 ${var}
requireNo执行后要求为 true 的变量名(如 click_success),不满足按出错处理
timeoutNo连接/读取超时毫秒(最小 1000)(默认 30000)
on_errorNo节点出错时:skip=跳过继续(默认),stop=停止整个工作流
output_varNo响应体另存到的变量名(http_response 总会写)
node_timeout_msNo单节点超时毫秒,0=不限;默认 30 分钟
max_response_bytesNo响应体上限字节,超出截断并置 http_truncated=true(默认 5242880)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does so well: it discloses that failures do not throw, defines http_success as status 200–399, notes default skip-on-failure, and warns that headers/body must be JSON-escaped strings or they silently degrade to {k=v} text. It does not cover redirect handling, auth requirements beyond the header example, or rate limits, so it stops short of a 5.

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

Conciseness4/5

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

It is front-loaded with purpose, then output fields, then failure semantics, then parameter gotchas — a sensible order with no filler sentences. It is dense to the point of being run-on and contains a duplicated sentence terminator ('。。'), but nothing is wasted.

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?

For a 10-parameter tool with no output schema, the description supplies exactly what is otherwise missing: the names and meaning of the returned variables (http_success, http_error, http_status_code, http_response, http_truncated) and the shape of the return (a variable snapshot JSON). Combined with the error-handling and interpolation notes, an agent has enough to invoke it correctly without further context.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description adds real meaning beyond the schema: the string-vs-nested-object gotcha for headers and body is a behavioral trap the schema does not flag, and it explains the require=http_success idiom. That is genuine added value over the structured fields.

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?

The first sentence states a specific verb and resource — send an HTTP request and store the response body in a variable — plus the precondition (network required). No sibling tool in the list performs HTTP requests, so no disambiguation is needed; an agent knows immediately this is the outbound-network action.

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?

It gives concrete when-to guidance: set a reasonable timeout for unstable third-party services, add require=http_success when a failed request should be treated as a node error, and rely on the default skip behavior otherwise. It lacks an explicit 'when not to use' clause, but with no competing HTTP sibling there is little to exclude.

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