Skip to main content
Glama
PageSpeed Insights MCP Server

PageSpeed Insights MCP Server

by sixees

Execute cURL Request

curl_execute

Execute HTTP requests with structured cURL parameters to fetch API data, format headers and forms, handle authentication, and extract JSON fields without building raw commands.

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 (a browser-like default is sent automatically if not set; empty string disables)

  • 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

  • jq_filter (string): JSON path filter to extract specific data

  • max_result_size (number): Max bytes to return inline (default: 500KB, max: 1MB). Auto-saves to file when exceeded

  • save_to_file (boolean): Force save response to temp file. Returns filepath instead of content

  • output_dir (string): Custom directory to save files (overrides MCP_CURL_OUTPUT_DIR env var)

jq_filter Syntax:

  • .key - Object property access

  • .[n] or .n - Array index (non-negative only, e.g., .results.0)

  • .[n:m] - Array slice from index n to m

  • .["key"] - Bracket notation for special characters in keys

  • .a,.b,.c - Multiple comma-separated paths (returns array of values, max 20)

jq_filter Validation:

  • Unclosed quotes and brackets throw clear errors

  • Leading zeros in indices rejected (use .0 not .00)

  • Negative indices not supported (unlike real jq)

  • Indices must be within safe integer range

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), "saved_to_file": boolean (if response was saved), "filepath": string (path to saved file) }

Examples:

Error Handling:

  • Returns error message if cURL fails or times out

  • Exit code 0 indicates success

  • Non-zero exit codes indicate various cURL errors

  • Invalid JSON with jq_filter returns error with response preview

Temp File Lifecycle: Files saved with save_to_file or auto-save are:

  • Stored in a secure temp directory (owner-only access: 0o700/0o600)

  • Deleted on graceful server shutdown (SIGINT/SIGTERM)

  • Orphaned files from crashed sessions are cleaned on next server start

  • Check mcp-curl-* in system temp dir if files persist after crash

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "url": "<url>"
    },
    "name": "curl_execute"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlYesThe URL to request
dataNoRequest body data (for POST/PUT/PATCH). Use JSON string for JSON payloads
formNoForm data as key-value pairs (uses multipart/form-data)
methodNoHTTP method (defaults to GET, or POST if data is provided)
headersNoHTTP headers as key-value pairs (e.g., {"Content-Type": "application/json"})
timeoutNoRequest timeout in seconds (default: 30, max: 300)
verboseNoInclude verbose output with request/response details
insecureNoSkip SSL certificate verification (default: false)
jq_filterNoJSON path filter to extract specific data. Supports: .key, .[n] or .n (non-negative array index), .[n:m] (slice), .["key"] (bracket notation), .a,.b (multiple comma-separated paths return array, max 20). Negative indices not supported. Applied after response, before max_result_size check.
basic_authNoBasic authentication in format 'username:password'
compressedNoRequest compressed response and automatically decompress
output_dirNoDirectory to save response files (must exist and be writable). Overrides MCP_CURL_OUTPUT_DIR env var. Falls back to system temp directory.
user_agentNoCustom User-Agent header. If not set, a browser-like User-Agent is sent automatically. Set to empty string to disable.
bearer_tokenNoBearer token for Authorization header
save_to_fileNoForce save response to temp file. Returns filepath instead of content
max_redirectsNoMaximum number of redirects to follow
include_headersNoInclude response headers in output
max_result_sizeNoMax bytes to return inline (default: 500KB, max: 1MB). Larger responses auto-save to temp file
follow_redirectsNoFollow HTTP redirects (default: true)
include_metadataNoWrap response in JSON with metadata (exit code, success status)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.1.1

TDQS

A4/5.0
Behavior5/5

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

Annotations already flag openWorldHint=true and readOnlyHint=false, but the description goes well beyond them: it discloses default behavior (follow_redirects true, compressed true, timeout 30s, browser-like User-Agent auto-sent), an auto-save threshold at 500KB with 1MB cap, error semantics (exit code 0 vs non-zero, timeout failures), and a detailed temp-file lifecycle including permissions (0o700/0o600), deletion on SIGINT/SIGTERM, and orphan cleanup. It also warns about the insecure SSL option and the fact that save_to_file returns a filepath instead of content. This is unusually rich behavioral disclosure for a network-executing tool.

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

Conciseness3/5

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

The material is well organized with clear section headers (Args, jq_filter Syntax, Returns, Examples, Error Handling, Temp File Lifecycle), but the Args block duplicates fields already documented at 100% coverage in the schema, and the jq_filter syntax section largely repeats the schema's jq_filter description. For a 20-parameter tool some length is justified, yet a meaningful fraction of the text does not earn its place.

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?

Despite 20 parameters, nested objects, and no output schema, the description covers everything an agent needs: defaults, bounds on timeout/max_redirects/max_result_size, the exact response shape when include_metadata is true, error handling behavior, and the lifecycle of files created by save_to_file. Nothing material about calling the tool correctly is left unstated.

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 description coverage is 100%, so the baseline is 3; the description clears that bar by adding the jq_filter validation rules (unclosed quotes/brackets throw clear errors, leading zeros rejected, safe integer range) and by showing composition in examples, such as escaping a JSON body inside the data string and pairing save_to_file with output_dir. Much of the Args block does restate schema descriptions verbatim, which keeps this from a 5.

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

Purpose4/5

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

The description opens with a specific verb and resource: 'Execute an HTTP request using cURL with structured parameters,' and follows with a sentence explaining the tool wraps cURL options while handling URL encoding, headers, and response processing. An agent can tell exactly what the tool does. It does not, however, name or differentiate itself from the sibling jq_query, so it falls short of the 5 bar for sibling differentiation.

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

Usage Guidelines3/5

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

Usage is shown only implicitly through eight examples (simple GET, POST JSON, auth, jq extraction, file output) and through the parameter list; the description never states when to prefer this tool over jq_query or when a request type is inappropriate. The examples do sketch realistic scenarios, which is more than nothing, but there is no explicit when/when-not guidance or alternative routing.

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