Development
Generate cURL and common language code snippets from a request URL, method, headers, query parameters, and body
Call this tool from your code in three languages.
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"}'Send a POST request with your inputs as JSON. File parameters require a separate upload first.
POST https://api.elysiatools.com/en/api/tools/api-request-code-snippet-generator| Name | Type | Required | Description |
|---|---|---|---|
| requestUrl | text | Yes | — |
| method | select | No | — |
| headersJson | textarea | No | — |
| queryJson | textarea | No | — |
| bodyInput | textarea | No | — |
| bodyType |
Add this tool to your Model Context Protocol server so AI agents can list and call it.
Add this block to your MCP client configuration:
{
"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"
}
}
}After connecting to the SSE endpoint, list the exposed tools:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}Invoke the tool by its id, passing arguments built from its parameters:
{
"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"
}
}
}| select |
| No |
| — |
| responseType | select | No | — |
HTML result
{
"result": "<div>Processed HTML content</div>",
"error": "Error message (optional)",
"message": "Notification message (optional)",
"metadata": {
"key": "value"
}
}Questions or issues? Contact [email protected]