Tools
get_elements
Bulk point-read for up to 100 elements in one call, with per-id soft-failure.
get_elements
Use this instead of N parallel
get_element calls when you have a known id list. Cap is 100 unique ids after server-side dedupe.Summary
Fetch multiple elements by id. Returns a map { element_id → element | null } — missing ids appear as null values and surface per-id errors alongside.
Input
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
version | string | yes | — | Schema version. |
element_ids | string[] | yes | — | 1–100 unique ids (each ≤128 chars). Server-side dedupes. |
locales | string[] | no | — | Locales to retain. |
fields | string[] | "all" | no | "all" | Field projection. |
Output — all hits
{
"ok": true,
"data": {
"version": "ai@2026-04-16-beta",
"elements": {
"purpose.example": { "id": "purpose.example", "...": "..." },
"data.camera": { "id": "data.camera", "...": "..." }
}
},
"meta": { "content_hash": "sha256-…", "version": "ai@2026-04-16-beta" }
}
Output — partial miss (soft-failure)
{
"ok": false,
"errors": [
{
"code": "element_not_found",
"message": "Element 'missing.id' not found.",
"path": "missing.id",
"fix_hint": "Use list_elements to enumerate available elements."
}
],
"meta": { "content_hash": "sha256-…", "version": "ai@2026-04-16-beta" },
"data": {
"version": "ai@2026-04-16-beta",
"elements": {
"purpose.example": { "id": "purpose.example", "...": "..." },
"missing.id": null
}
}
}
The MCP tool result sets isError: false for this case — hits are preserved, misses surface as errors. See envelope.
Errors
| Code | Meaning | Fix |
|---|---|---|
invalid_arguments | element_ids empty / non-string / id too long. | Fix the call. |
element_ids_too_many | >100 unique ids after dedupe. | Split into batches of ≤100 or use list_elements. |
unknown_version | Version is not registered. | Call list_schema_versions. |
element_not_found | Per-id miss (soft-failure). | Inspect data.elements[id] === null. |
Example
curl -s https://api.dtpr.io/mcp \
-H 'content-type: application/json' \
--data '{
"jsonrpc":"2.0","id":1,
"method":"tools/call",
"params":{
"name":"get_elements",
"arguments":{
"version":"ai@2026-04-16-beta",
"element_ids":["purpose.example","data.camera","missing.id"],
"locales":["en"]
}
}
}'
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "get_elements",
"arguments": {
"version": "ai@2026-04-16-beta",
"element_ids": ["purpose.example", "data.camera"]
}
}
}
See also
- Envelope — soft-failure
- REST pagination & fields
list_elements— when you don't have an id list.