Skip to main content
Glama

curl_execute

Execute HTTP requests using structured cURL parameters to handle URL encoding, headers, authentication, and response processing automatically.

Instructions

Execute an HTTP request using cURL with structured parameters.

This tool provides a safe, structured way to make HTTP requests with common cURL options. It handles URL encoding, header formatting, and response processing automatically.

Args:

  • url (string, required): The URL to request

  • method (string): HTTP method - GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS

  • headers (object): HTTP headers as key-value pairs

  • data (string): Request body for POST/PUT/PATCH requests

  • form (object): Form data as key-value pairs (multipart/form-data)

  • follow_redirects (boolean): Follow HTTP redirects (default: true)

  • max_redirects (number): Maximum redirects to follow (0-50)

  • insecure (boolean): Skip SSL verification (default: false)

  • timeout (number): Request timeout in seconds (1-300, default: 30)

  • user_agent (string): Custom User-Agent header

  • basic_auth (string): Basic auth as "username:password"

  • bearer_token (string): Bearer token for Authorization header

  • verbose (boolean): Include verbose request/response details

  • include_headers (boolean): Include response headers in output

  • compressed (boolean): Request compressed response (default: true)

  • include_metadata (boolean): Wrap response in JSON with metadata

Returns: The HTTP response body, or JSON with metadata if include_metadata is true: { "success": boolean, "exit_code": number, "response": string, "stderr": string (if present) }

Examples:

  • Simple GET: { "url": "https://api.example.com/data" }

  • POST JSON: { "url": "https://api.example.com/users", "method": "POST", "headers": {"Content-Type": "application/json"}, "data": "{"name": "John"}" }

  • With auth: { "url": "https://api.example.com/secure", "bearer_token": "your-token-here" }

Error Handling:

  • Returns error message if cURL fails or times out

  • Exit code 0 indicates success

  • Non-zero exit codes indicate various cURL errors

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesThe URL to request
methodNoHTTP method (defaults to GET, or POST if data is provided)
headersNoHTTP headers as key-value pairs (e.g., {"Content-Type": "application/json"})
dataNoRequest body data (for POST/PUT/PATCH). Use JSON string for JSON payloads
formNoForm data as key-value pairs (uses multipart/form-data)
follow_redirectsNoFollow HTTP redirects (default: true)
max_redirectsNoMaximum number of redirects to follow
insecureNoSkip SSL certificate verification (default: false)
timeoutNoRequest timeout in seconds (default: 30, max: 300)
user_agentNoCustom User-Agent header
basic_authNoBasic authentication in format 'username:password'
bearer_tokenNoBearer token for Authorization header
verboseNoInclude verbose output with request/response details
include_headersNoInclude response headers in output
compressedNoRequest compressed response and automatically decompress
include_metadataNoWrap response in JSON with metadata (exit code, success status)

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sixees/mcp-curl'

If you have feedback or need assistance with the MCP directory API, please join our Discord server