Submit Generation Async
Immutable Catalog Entry
This descriptor comes from the active versioned Portal catalog.
- Contract tier:
agent_ready - Risk:
write - Catalog version:
leonardo-ai-2026.07.12.1 - Descriptor hash:
4386a5375c4926eb5849c9d0877195d60224577cdf062656ac09f38a9ba1eee3
Submit a Leonardo job, store its ID locally, and rely on webhook completion. Requires the request-scoped x-leonardo-api-key Portal field and contacts Leonardo.Ai.
Request Body
{
"jsonrpc": "2.0",
"id": "leonardo-ai-leonardo-submit-generation-async-example",
"method": "tools/call",
"params": {
"name": "leonardo-ai.leonardo_submit_generation_async",
"arguments": {
"body": "",
"mode": "v2_media",
"request_body": ""
}
}
}
Arguments Schema
{
"type": "object",
"properties": {
"body": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null,
"description": "Leonardo request body using provider parameter names exactly. For v1 image generation use fields such as prompt, modelId, width, height, num_images, alchemy, ultra, public, imagePrompts, init_image_id, or isInitImage. For v2 generation use model, public, and parameters."
},
"mode": {
"enum": [
"v2_media",
"v1_image",
"image_to_video",
"text_to_video",
"svd_motion",
"video_upscale"
],
"type": "string",
"default": "v2_media",
"description": "Leonardo async generation endpoint family to submit."
},
"request_body": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null,
"description": "Alias for body. Use when an agent has a planned request_body from a planning tool."
}
},
"additionalProperties": false
}
Output Schema
{
"type": "object",
"description": "Leonardo MCP result. ok=false, provider_ok=false, a failed status, or an error field represents a semantic failure even when transport delivery succeeded.",
"additionalProperties": true
}
Code Examples
- cURL
- Node.js
- Python
curl -X POST 'https://portal.madpanda3d.com/api/mcp' \
-H 'Authorization: Bearer mad_live_***' \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": "leonardo-ai-leonardo-submit-generation-async-example",
"method": "tools/call",
"params": {
"name": "leonardo-ai.leonardo_submit_generation_async",
"arguments": {
"body": "",
"mode": "v2_media",
"request_body": ""
}
}
}'
const response = await fetch('https://portal.madpanda3d.com/api/mcp', {
method: 'POST',
headers: {
Authorization: 'Bearer mad_live_***',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"jsonrpc": "2.0",
"id": "leonardo-ai-leonardo-submit-generation-async-example",
"method": "tools/call",
"params": {
"name": "leonardo-ai.leonardo_submit_generation_async",
"arguments": {
"body": "",
"mode": "v2_media",
"request_body": ""
}
}
}),
});
const data = await response.json();
console.log(data);
import requests
url = 'https://portal.madpanda3d.com/api/mcp'
headers = {
'Authorization': 'Bearer mad_live_***',
'Content-Type': 'application/json',
}
payload = {
"jsonrpc": "2.0",
"id": "leonardo-ai-leonardo-submit-generation-async-example",
"method": "tools/call",
"params": {
"name": "leonardo-ai.leonardo_submit_generation_async",
"arguments": {
"body": "",
"mode": "v2_media",
"request_body": ""
}
}
}
response = requests.post(url, headers=headers, json=payload, timeout=60)
print(response.json())
Example Responses
- 200 Success
- 502 Upstream Error
{
"ok": true,
"message": "Tool leonardo-ai.leonardo_submit_generation_async executed successfully.",
"note": "Response shape varies by MCP tool. Inspect live responses for exact fields."
}
{
"ok": false,
"classification": "upstream_http_error",
"message": "Upstream MCP returned a non-success status."
}