Skip to main content
Glama

cURL to code

curl_to_code
Read-onlyIdempotent

Convert curl commands into JavaScript fetch, axios, Python requests, PHP cURL, Go, or Node.js code and return a parsed request summary without sending the request.

Instructions

Convert a curl command (bash/zsh quoting incl. $'…', line continuations, "Copy as cURL" from browsers) into code for JavaScript fetch, axios, Python requests, PHP cURL, Go net/http or Node.js http/https: every target the website supports. Understands -X, -H, -d/--data-raw/--data-binary/--data-urlencode, --json, -F forms and files, -u, -b, -A, -e, -G, -I, -k, -L, -m, --connect-timeout, -x, -T, --compressed, --oauth2-bearer. Also returns the parsed request (secrets masked unless revealSecrets) and notes on what could not be converted. Only parses text; never sends the request. Web version: https://s3eidat.github.io/curl-convert/

Input Schema

NameRequiredDescriptionDefault
outputNoOptional: write the code to this file (single language only).
commandYesThe curl command, e.g. "curl -X POST https://api.example.com -H 'Content-Type: application/json' -d '{"a":1}'".
languageNoTarget: fetch (browser/Node fetch), axios, python (requests), php (cURL), go (net/http), node (http/https), or "all".fetch
revealSecretsNoShow Authorization/Cookie/API-key header values and the basic-auth password in the parsed summary (the code always contains them).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint/idempotent/openWorld=false, and the description is consistent with them, reinforcing that nothing is sent over the network. It adds real behavioral detail beyond annotations: the response includes the parsed request with secrets masked unless revealSecrets, plus 'notes on what could not be converted', so an agent knows partial conversions are possible rather than failing.

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?

Front-loaded with the verb, resource, and target list before the dense flag enumeration and the safety note. The long flag sentence is informative but heavy; it could have been trimmed to categories without losing much, though every clause does carry content.

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?

With no output schema, the description carries the return-value burden and does so: converted code, parsed request with masked secrets, and conversion notes. It does not spell out the response's field layout or what 'all' produces as a payload shape, leaving a small gap for a tool an agent will parse results from.

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; the description earns an extra point by documenting the curl flag vocabulary the `command` parameter accepts (-X, -H, -d/--data-raw/--data-binary/--data-urlencode, --json, -F, -u, -b, -A, -e, -G, -I, -k, -L, -m, -x, -T, --compressed, --oauth2-bearer), which is meaning the schema's single example does not convey. It also clarifies that 'output' implies a single language only, matching the enum constraint.

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 ('Convert a curl command ... into code') and enumerates the exact target languages (fetch, axios, python, php, go, node). No sibling tool in the list does this, so it is trivially distinguishable from formatting/encoding utilities like json_format or url_encode.

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 clear triggering context — bash/zsh quoting incl. $'…', line continuations, browser 'Copy as cURL' — and an explicit boundary: 'Only parses text; never sends the request', which steers agents away from ai_web_fetch for execution. It does not name an alternative tool explicitly, so it stops short of a full when/when-not routing statement.

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