Skip to main content
Glama

TestingAPIs API tools

Convert a cURL command to code

curl_to_code
Read-onlyIdempotent

Turn a cURL command (bash, Windows cmd or PowerShell, as copied from browser devtools) into the same request in Python requests, JavaScript fetch or axios, Go, Java, C#, PHP, or a tidy cURL command. Headers, body, auth, timeouts and redirects are carried over.

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": {
      "command": "<command>",
      "language": "<language>"
    },
    "name": "curl_to_code"
  }
}

Input Schema

NameRequiredDescriptionDefault
commandYesThe cURL command.
languageYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false and openWorldHint=false, so the safety profile is covered. The description adds real context beyond that: which shell flavours of cURL are accepted and exactly what gets preserved ('Headers, body, auth, timeouts and redirects are carried over'). It stops short of stating that nothing is executed or how unsupported flags are handled.

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?

Two dense sentences, zero filler, with the conversion action front-loaded and the fidelity guarantees ('headers, body, auth, timeouts and redirects') placed second. Nothing is redundant with the title or schema.

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

Completeness4/5

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

For a two-parameter, non-destructive converter with no output schema, the description covers input dialects, output targets and what is preserved, which is enough to call it correctly. The minor gap is that it never characterizes the return value (a code snippet string) or failure behavior on malformed commands, which matters slightly more given there is no output schema to fall back on.

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 only 50% — 'command' is documented but 'language' is not — so the description has to compensate, and it does by enumerating the target languages and clarifying that 'curl' means a normalized/tidy cURL command rather than a conversion. It also clarifies the command parameter by naming the shell dialects accepted.

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 and resource ('Turn a cURL command ... into the same request in Python requests, JavaScript fetch or axios, Go, Java, C#, PHP, or a tidy cURL command') and names the full set of target outputs. An agent can tell instantly this is a code-generation/conversion tool with no overlap with siblings like validate_json_schema or explain_cron.

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 implied by the accepted input flavours ('bash, Windows cmd or PowerShell, as copied from browser devtools'), which tells the agent when input is suitable, but there is no explicit when-to-use vs when-not, no prerequisite/permission notes, and no alternatives named. Adequate but leaves routing to inference.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources