MCPcopy Create free account
hub / github.com/github/copilot-sdk / CanvasDeclaration

Class CanvasDeclaration

python/copilot/canvas.py:70–104  ·  view source on GitHub ↗

Declarative metadata for a single canvas, sent on create/resume. .. note:: **Experimental.** This type is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases.

Source from the content-addressed store, hash-verified

68
69@dataclass
70class CanvasDeclaration:
71 """Declarative metadata for a single canvas, sent on create/resume.
72
73 .. note::
74
75 **Experimental.** This type is part of an experimental wire-protocol
76 surface and may change or be removed in future SDK or CLI releases.
77 """
78
79 id: str
80 """Canvas identifier, unique within the declaring connection."""
81
82 display_name: str
83 """Human-readable name shown in host UI and canvas pickers."""
84
85 description: str
86 """Short description shown to the agent in canvas catalogs."""
87
88 input_schema: CanvasJsonSchema | None = None
89 """JSON Schema for the ``input`` payload accepted by ``canvas.open``."""
90
91 actions: list[CanvasAction] | None = None
92 """Agent-callable actions this canvas exposes."""
93
94 def to_dict(self) -> dict[str, Any]:
95 result: dict[str, Any] = {
96 "id": self.id,
97 "displayName": self.display_name,
98 "description": self.description,
99 }
100 if self.input_schema is not None:
101 result["inputSchema"] = self.input_schema
102 if self.actions is not None:
103 result["actions"] = [action.to_dict() for action in self.actions]
104 return result
105
106
107class CanvasError(Exception):

Calls

no outgoing calls

Used in the wild real call sites across dependent graphs

searching dependent graphs…