enhancedocs
For agentsOpen Enhance ↗
Reference / canvas.selection

Enhance documentation

canvas.selection

Read the accountable person’s most recently changed live browser selection at an exact canvas version.

↓ Markdown

canvas.selection

query read

Use when current canvas state is missing from the task context.

Before calling

  • Authenticate as the accountable Enhance person.
  • Use only resource identifiers returned by an earlier capability result or supplied by the person.

Input

Show complete JSON Schema
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"canvasId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["canvasId"]}

Example

Show example input
{
 "canvasId": "00000000-0000-4000-8000-000000000010"
}

Result

Returns a typed canvas.selection result from the Enhance API without transport-specific prose.

  • canvasId (required): Returned field canvasId.
  • status (required): Returned field status.
  • documentVersion (required): Returned field documentVersion.
  • selectionRevision (required): Returned field selectionRevision.
  • selectionChangedAt (required): Returned field selectionChangedAt.
  • selectedNodeIds (required): Returned field selectedNodeIds.
  • missingNodeIds (required): Returned field missingNodeIds.
  • nodes (required): Returned field nodes.
  • contextRootId (required): Returned field contextRootId.
  • visibleWorldBox (required): Returned field visibleWorldBox.
  • next (required): Returned field next.
Show complete result JSON Schema
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"canvasId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["selected","none","offline","stale","updating","unsupported"]},"documentVersion":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"selectionRevision":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"selectionChangedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"selectedNodeIds":{"type":"array","items":{"type":"string","minLength":1}},"missingNodeIds":{"type":"array","items":{"type":"string","minLength":1}},"nodes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"label":{"type":"string","maxLength":500},"kind":{"type":"string","minLength":1,"maxLength":100},"parentId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"childCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"box":{"anyOf":[{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"},"width":{"type":"number","exclusiveMinimum":0},"height":{"type":"number","exclusiveMinimum":0}},"required":["x","y","width","height"],"additionalProperties":false},{"type":"null"}]},"propertySections":{"type":"array","items":{"type":"string","enum":["position","layout","clip","cornerRadius","blending","typography","nativeControl","textDecoration","fill","outline","textStroke","border","outerShadow","innerShadow","filters","additionalStyles","vector","export","source"]}}},"required":["id","label","kind","parentId","childCount","box","propertySections"],"additionalProperties":false}},"contextRootId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"visibleWorldBox":{"anyOf":[{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"},"width":{"type":"number","exclusiveMinimum":0},"height":{"type":"number","exclusiveMinimum":0}},"required":["x","y","width","height"],"additionalProperties":false},{"type":"null"}]},"next":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1}}},"required":["canvasId","status","documentVersion","selectionRevision","selectionChangedAt","selectedNodeIds","missingNodeIds","nodes","contextRootId","visibleWorldBox","next"],"additionalProperties":false}

Example result

Show example result
{
 "canvasId": "00000000-0000-4000-8000-000000000010",
 "status": "selected",
 "documentVersion": 1,
 "selectionRevision": 1,
 "selectionChangedAt": "2026-08-10T00:00:00.000Z",
 "selectedNodeIds": [],
 "missingNodeIds": [],
 "nodes": [],
 "contextRootId": "x",
 "visibleWorldBox": {
  "x": 0,
  "y": 0,
  "width": 1,
  "height": 1
 },
 "next": []
}

Recovery

  • BAD_REQUEST: correct the named fields and call again.
  • UNAUTHORIZED: restore Enhance authentication, then retry once.
  • FORBIDDEN or NOT_FOUND: check the supplied resource and selection; do not substitute unrelated content. Ask for corrected access or scope if needed.
  • CONFLICT: read the current resource, merge the intended change, and retry with its version.
  • INTERNAL: run Enhance diagnostics, report the failure, and stop repeating the call.

Continue with

  • Use the returned identifiers and version in the next canvas operation.

Versions

Compatibility: da0bd56942b974a6308dccd58e1a86841a608da49594e28d2b3f0e89539fdfa5.

Minimum tested versions: Enhance CLI and MCP runtime 0.1.40, plugin 1.0.38, Node.js 24. No older floor is published.