Development
API Request Code Snippet Generator
Generate cURL and common language code snippets from a request URL, method, headers, query parameters, and body
html· HTML resultOpen tool
Quick start
Call this tool from your code in three languages.
cURL
curl -X POST 'https://api.elysiatools.com/en/api/tools/api-request-code-snippet-generator' \
-H 'Content-Type: application/json' \
-d '{"requestUrl":"https://api.example.com/users","method":"POST","headersJson":"{\n \"Authorization\": \"Bearer demo-token\",\n \"Accept\": \"application/json\"\n}","queryJson":"{\n \"invite\": \"true\"\n}","bodyInput":"{\n \"name\": \"Alice\",\n \"email\": \"[email protected]\"\n}","bodyType":"json","responseType":"json"}'API reference
Send a POST request with your inputs as JSON. File parameters require a separate upload first.
Endpoint
HTTP
POST https://api.elysiatools.com/en/api/tools/api-request-code-snippet-generatorParameters
| Name | Type | Required | Description |
|---|---|---|---|
| requestUrl | text | Yes | — |
| method | select | No | — |
| headersJson | textarea | No | — |
| queryJson | textarea | No | — |
| bodyInput | textarea | No | — |
| bodyType |
MCP integration
Add this tool to your Model Context Protocol server so AI agents can list and call it.
Server configuration
Add this block to your MCP client configuration:
mcp.json
{
"mcpServers": {
"elysiatools-api-request-code-snippet-generator": {
"name": "api-request-code-snippet-generator",
"description": "Generate cURL and common language code snippets from a request URL, method, headers, query parameters, and body",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=api-request-code-snippet-generator",
"command": "",
"args": [],
"env": {},
"isActive": true,
"type": "sse"
}
}
}List available tools
After connecting to the SSE endpoint, list the exposed tools:
tools/list
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}Call this tool
Invoke the tool by its id, passing arguments built from its parameters:
tools/call
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "api-request-code-snippet-generator",
"arguments": {
"requestUrl": "https://api.example.com/users",
"method": "POST",
"headersJson": "{\n \"Authorization\": \"Bearer demo-token\",\n \"Accept\": \"application/json\"\n}",
"queryJson": "{\n \"invite\": \"true\"\n}",
"bodyInput": "{\n \"name\": \"Alice\",\n \"email\": \"[email protected]\"\n}",
"bodyType": "json",
"responseType": "json"
}
}
}Chain multiple tools in one session with a comma-separated toolId list, e.g. /mcp/sse?toolId=png-to-webp,jpg-to-webp,gif-to-webp (max 20).