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": "dtpr@2026-09-01-beta",
"datachain": { /* DatachainInstance — `id`, `schema_version`, `created_at`, and a non-empty `elements[]` are required */ }
}
Output — success
{
"structuredContent": {
"ok": true,
"data": {
"id": "acme-resume-screener",
"schema_version": "dtpr@2026-09-01-beta",
"created_at": "2026-09-01T00:00:00Z",
"elements": [ "/* the placements from the request, unchanged */" ],
"schema_snapshot": { "datachain_type": {...}, "categories": [...], "elements": [...] },
"suggested_elements": []
},
"meta": { "content_hash": "sha256-…", "version": "dtpr@2026-09-01-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":"dtpr@2026-09-01-beta",
"datachain":{
"id":"acme-resume-screener",
"schema_version":"dtpr@2026-09-01-beta",
"created_at":"2026-09-01T00:00:00Z",
"elements":[
{"element_id":"employment"},
{"element_id":"organization","context_type_id":"deployer","variables":[
{"id":"title","value":[{"locale":"en","value":"Acme Corp"}]},
{"id":"description","value":[{"locale":"en","value":"Runs the screener."}]}]},
{"element_id":"people","context_type_id":"subject","variables":[
{"id":"title","value":[{"locale":"en","value":"Job applicants"}]},
{"id":"description","value":[{"locale":"en","value":"Anyone who submits a resume."}]}]},
{"element_id":"recommends","context_type_id":"human_decides"}
]
}
}
}
}'
See also
- REST
POST /schemas/:version/resolve— same operation over plain HTTP. - MCP
validate_resolved— validate the resolved form this tool produces. - Datachains — both wire forms, conditional round-trip rule, and the
schema_snapshottrust boundary.