Taxonomy
Tools

MCP tool: resolve_datachain

Compose a thin DatachainInstance plus the pinned schema slice into a ResolvedDatachainInstance.

resolve_datachain

Soft-failure (isError: false) on parse and semantic-validate errors. The 512 KB cap returns a payload_too_large error envelope.

Summary

MCP sibling to POST /schemas/:version/resolve. Composes a thin DatachainInstance and the pinned schema's lean subset (datachain_type + referenced categories + referenced elements) into a single self-contained ResolvedDatachainInstance.

Input

{
  "version": "ai@2026-04-16-beta",
  "datachain": { /* DatachainInstance */ }
}

Output — success

{
  "structuredContent": {
    "ok": true,
    "data": {
      "id": "",
      "schema_version": "ai@2026-04-16-beta",
      "elements": [{"element_id":"accept_deny"}],
      "schema_snapshot": { "datachain_type": {...}, "categories": [...], "elements": [...] },
      "suggested_elements": []
    },
    "meta": { "content_hash": "sha256-…", "version": "ai@2026-04-16-beta" }
  },
  "content": [{ "type": "text", "text": "{...}" }]
}

Output — semantic failure

{
  "structuredContent": {
    "ok": false,
    "errors": [{ "code": "INSTANCE_ELEMENT_UNKNOWN", "message": "", "path": "elements[0]" }]
  }
}

Output — payload too large

When the resolved bundle exceeds 512 KB, the soft-failure envelope carries a typed payload_too_large error (no HTTP semantics in MCP):

{
  "structuredContent": {
    "ok": false,
    "errors": [
      {
        "code": "payload_too_large",
        "message": "Resolved bundle exceeds 524288-byte cap (got 612904).",
        "fix_hint": "Reduce locales/elements/categories pinned by the schema, or fetch the schema content separately."
      }
    ]
  }
}

Example

curl -s https://api.dtpr.io/mcp \
  -H 'content-type: application/json' \
  -H 'accept: application/json, text/event-stream' \
  --data '{
    "jsonrpc":"2.0","id":1,
    "method":"tools/call",
    "params":{
      "name":"resolve_datachain",
      "arguments":{
        "version":"ai@2026-04-16-beta",
        "datachain":{
          "schema_version":"ai@2026-04-16-beta",
          "elements":[{"element_id":"accept_deny"}]
        }
      }
    }
  }'

See also