Leonardo Get Element By Id
Immutable Catalog Entry
This descriptor comes from the active versioned Portal catalog.
- Contract tier:
agent_ready - Risk:
read - Catalog version:
leonardo-ai-2026.07.12.1 - Descriptor hash:
87e51fdc325886ae495f2729f602c6efe9455058a9122703238d944a09f421ac
Use this to call Leonardo.Ai Elements endpoint GET /elements/{id}. Get a custom element by ID. Contacts Leonardo.Ai using the BYOK x-leonardo-api-key portal header. Provide path_params for: id. Returns a compact, sanitized provider response.
Request Body
{
"jsonrpc": "2.0",
"id": "leonardo-ai-leonardo-get-element-by-id-example",
"method": "tools/call",
"params": {
"name": "leonardo-ai.leonardo_get_element_by_id",
"arguments": {
"body": "",
"query": "",
"confirm": false,
"path_params": "",
"query_params": "",
"request_body": ""
}
}
}
Arguments Schema
{
"type": "object",
"properties": {
"body": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null,
"description": "JSON request body for the Leonardo endpoint. Use provider parameter names exactly, including casing such as `modelId`, `num_images`, or `init_image_id`."
},
"query": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null,
"description": "Query string parameters for the Leonardo endpoint. Omit when unused."
},
"confirm": {
"type": "boolean",
"default": false,
"description": "Must be true for destructive DELETE tools. Ignored for non-destructive tools."
},
"path_params": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null,
"description": "Values for path placeholders in the endpoint path, such as `{'id': '...'}` or `{'datasetId': '...'}`. Omit when the endpoint has no placeholders."
},
"query_params": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null,
"description": "Query string parameters for the Leonardo endpoint. Omit when unused."
},
"request_body": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null,
"description": "JSON request body for the Leonardo endpoint. Use provider parameter names exactly, including casing such as `modelId`, `num_images`, or `init_image_id`."
}
},
"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-get-element-by-id-example",
"method": "tools/call",
"params": {
"name": "leonardo-ai.leonardo_get_element_by_id",
"arguments": {
"body": "",
"query": "",
"confirm": false,
"path_params": "",
"query_params": "",
"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-get-element-by-id-example",
"method": "tools/call",
"params": {
"name": "leonardo-ai.leonardo_get_element_by_id",
"arguments": {
"body": "",
"query": "",
"confirm": false,
"path_params": "",
"query_params": "",
"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-get-element-by-id-example",
"method": "tools/call",
"params": {
"name": "leonardo-ai.leonardo_get_element_by_id",
"arguments": {
"body": "",
"query": "",
"confirm": false,
"path_params": "",
"query_params": "",
"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_get_element_by_id 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."
}