Microsoft.Teams.Apps.HtmlWidget Namespace

Classes

Name Description
CallToolRequest

A request from a widget to call a tool on the bot. Sent as the value of an htmlwidget/calltool invoke activity.

HtmlWidgetCallToolExtensions

Extension methods for registering HTML widget call tool invoke handlers.

HtmlWidgetCallToolResponse

The wire-format response body for an htmlwidget/calltool invoke. Teams expects this shape (with responseType discriminator) rather than a bare McpUiCallToolResult.

HtmlWidgetHelpers

Helper methods for building and validating HTML widget messages.

HtmlWidgetMarkdownOptions

Options for building an HTML widget markdown string.

HtmlWidgetPayload

The JSON payload for an HTML widget, sent inside a ```html-widget code block within a Markdown message.

HtmlWidgetPermissions

Permissions that the widget may request from the host. Presence of a field means the permission is requested (value should be an empty object).

HtmlWidgetSecurityPolicy

The security policy for an HTML widget, controlling allowed origins for network requests, static resources, nested iframes, and base URIs.

InjectWidgetProtocolOptions

Options for injecting the MCP Apps protocol into widget HTML.

McpUiCallToolResult

The result of a widget's tools/call request, returned by the bot in response to an htmlwidget/calltool invoke activity.

McpUiCallToolResultContent

A content item in an MCP UI call tool result. The populated fields depend on Type: "text" uses Text; "image" and "audio" use Data and MimeType; "resource" uses Resource. Teams currently only renders "text" content; the other types are defined by the MCP spec for forward compatibility.

McpUiResource

An embedded resource referenced by a "resource" content item.

McpUiUpdateModelContextParams

The parameters of an MCP UI ui/update-model-context request. The content blocks reuse the same union as McpUiCallToolResult, as defined by the MCP Apps (ext-apps) specification.

McpUiUpdateModelContextRequest

A widget's request to update the model context, delivered on the value of a message activity (reusing the messageBack mechanism, fire-and-forget). Defined by the MCP Apps (ext-apps) specification.

SecurityPolicyWarning

A warning produced by ValidateSecurityPolicy(String, HtmlWidgetSecurityPolicy) when the widget HTML references an external origin not present in the declared security policy.

Delegates

Name Description
HtmlWidgetCallToolHandler

Delegate for handling htmlwidget/calltool invoke activities. Sent when a widget calls a tool on the bot via the MCP Apps protocol.