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

FieldTypeRequiredDefaultDescription
versionstringyesSchema version.
element_idsstring[]yes1–100 unique ids (each ≤128 chars). Server-side dedupes.
localesstring[]noLocales to retain.
fieldsstring[] | "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

CodeMeaningFix
invalid_argumentselement_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_versionVersion is not registered.Call list_schema_versions.
element_not_foundPer-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"]
      }
    }
  }'

See also

Copyright © 2026