Skip to content

card

Wire-format contract for the Teams add-on: the semantic card a model drafts and the Adaptive Card document that drafting compiles to. Pure (zod + inferred types, no Node-only imports) so the server-side card builder, the Mastra tool, and the React Adaptive Cards renderer all validate / type against one definition.

The model does NOT hand-author raw Adaptive Card JSON. It describes a card in a small, high-level vocabulary (CardSpec) - a title, some text/fact blocks, and optional link actions - and the builder compiles that into a valid Adaptive Card 1.5 document (AdaptiveCard). Keeping the model’s surface small avoids the two failure modes of free-form card JSON: an invalid schema the renderer rejects, and a card that renders but ignores Teams’ host constraints.

Array fields intentionally avoid .min() / .nonempty(): those emit minItems in the JSON schema, which some Model Serving endpoints reject (“array types do not support minItems”) when the schema is forwarded as a tool definition.