Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Message formatting enables you to bring out the best in agent messages. You can format your agent messages to include rich cards as attachments that contain interactive elements, such as buttons, text, and images.
Note
Regarding agent message size limit:
- The agent message size limit is 100 KB:
- 100 KB is an approximate limit because it includes the message itself (text, image links, etc.), @-mentions, and reactions encoded as UTF-16. This 100 KB size limitation doesn't include base64 encoded image.
- During implementation, it's recommended to ensure that the size of the message itself is within 80 KB to guarantee successful message delivery.
- If the agent message exceeds the size limit, the agent receives a
413status code (RequestEntityTooLarge), which contains the error codeMessageSizeTooBig.
Format text content
To format your agent messages, you can set the optional TextFormat property to control how your agent message's text content is rendered.
Microsoft Teams supports the following formatting options:
TextFormat value |
Description |
|---|---|
plain |
The text is treated as raw text with no formatting applied. |
markdown |
The text is treated as Markdown formatting and rendered on the channel as appropriate. |
extendedmarkdown |
The text is treated as extended Markdown, supporting richer rendering for text-only messages such as tables, task lists, code fences, math equations, images, at-mentions, and citations. |
xml |
The text uses a subset of HTML tags for formatting in rich cards. For supported tags, see format cards. |
Note
Support for extended markdown is available in public developer preview.
For markdown, Teams supports a subset of Markdown formatting. For extendedmarkdown, Teams supports CommonMark syntax along with additional features such as tables, task lists, code fences, math equations, images, at-mentions, and citations. In extended Markdown content, <at> is the only supported HTML tag.
The following limitations apply to formatting:
- Text-only messages in
plainformat don't support table formatting. - Rich cards support formatting in the text property only, not in the title or subtitle properties.
- For rich card payload properties,
markdownandextendedmarkdownformatting aren't supported. - Older or unsupported clients can show unsupported constructs as plain text.
After you format text content, ensure that your formatting works across all platforms supported by Teams.
Set message text format
To set the text format, specify the textFormat property in your Activity object. The following example shows how to send a message with extendedmarkdown formatting:
{
"type": "message",
"textFormat": "extendedmarkdown",
"text": "### Sprint update\n\n- [x] Build completed\n- [1] Deploy pending"
}
Standard Markdown support
Some styles aren't supported across all platforms. The following table provides a list of standard Markdown styles and which of these styles are supported in text-only messages and rich cards:
| Style | Text-only messages | Rich cards - XML only |
|---|---|---|
| Bold | ✔️️ | ❌ |
| Italic | ✔️ | ✔️ |
| Header (levels 1–3) | ❌ | ✔️ |
| Strikethrough | ❌ | ✔️ |
| Horizontal rule | ❌ | ❌ |
| Unordered list | ❌ | ✔️ |
| Ordered list | ❌ | ✔️ |
| Preformatted text | ✔️ | ✔️ |
| Blockquote | ✔️ | ✔️ |
| Hyperlink | ✔️ | ✔️ |
| Image link | ❌ | ❌ |
Extended Markdown features
When using textFormat: "extendedmarkdown", the following features are available in text-only messages:
| Feature | Syntax | Description |
|---|---|---|
| Fenced code blocks | Use triple backticks with a language identifier, for example ```python |
Syntax-highlighted code fences |
| Math equations | Inline: $E = mc^2$ Block: $$\int_0^\infty f(x)dx$$ |
LaTeX/KaTeX math notation rendered inline or as a block |
| Images and image URLs |  |
Render image content from Markdown |
| At-mentions | <at>User Name</at> or <at>GroupName</at> |
Reference users or groups |
| Citations | [#] in message text + entities array in Activity |
Inline citation markers with reference details. For more information, see citations. |
| Tables | Pipe-delimited rows with separator line | Structured tabular data with optional column alignment |
| Task lists | - [ ] item / - [x] item |
Checklist-style items; checkboxes are read-only |
At-mention support
Mention users and groups in your agent messages. At-mentions work with both standard Markdown and extended Markdown:
Hello <at>Jane Smith</at>, please review this.
Notifying team: <at>Engineering Team</at>
Fenced code blocks
Use triple backticks with a language identifier to display syntax-highlighted code in your agent messages.
```python
def fibonacci(n):
if n <= 1:
return n
return fibonacci(n-1) + fibonacci(n-2)
```
Math equations
Use LaTeX/KaTeX syntax to render mathematical notation. Use single dollar signs for inline equations and double dollar signs for block equations.
Inline math: $E = mc^2$
Block math:
$$
\int_0^\infty f(x)dx
$$
Images
Use standard Markdown image syntax to render images in your agent messages.

Citations
Cite sources in your agent messages using [#] notation in the message text and providing citation details in the Activity entities array. For more information on how to add citations, see citations.
Tables
Use GitHub Flavored Markdown (GFM) table syntax to present structured data. Tables support column alignment using colons in the separator row.
| Feature | Status | Priority |
|:--------|:------:|----------:|
| Tables | Done | High |
| Math | Done | High |
In this example, the first column is left-aligned, the second is centered, and the third is right-aligned.
Task lists
Use task list syntax to display completed and pending items in your agent messages.
- [x] Checkout code
- [x] Install dependencies
- [x] Run unit tests
- [ ] Deploy to production
Note
Task list checkboxes are read-only. Users can't interact with them to change their state.
Streaming with extended Markdown
Extended Markdown content will render as it streams:
- Fenced code blocks: Render only after the closing
```fence is received on its own line - Math equations: Render after the closing
$or$$delimiter is received - Images and image URLs: Render after the closing parenthesis of the image URL passes validation
- At-mentions: Render when
<at>...</at>tags are complete and valid - Citations: Render when
[#]markers and correspondingentitiesare present in the Activity - Tables: Render when enough rows are received to form a valid table structure
- Task lists: Render when list items and checkbox markers (
- [ ],- [x]) are complete
For detailed information about streaming implementation, see Stream agent messages.
Support by individual platform
Support for text formatting varies by type of message and platform.
Text-only messages
The following table provides a list of styles, which are supported on desktop, iOS, and Android:
| Style | Desktop | iOS | Android |
|---|---|---|---|
| Bold | ✔️ | ✔️ | ✔️ |
| Italic | ✔️ | ✔️ | ✔️ |
| Header (levels 1–3) | ❌ | ❌ | ❌ |
| Strikethrough | ✔️ | ✔️ | ❌ |
| Horizontal rule | ❌ | ❌ | ❌ |
| Unordered list | ✔️ | ❌ | ❌ |
| Ordered list | ✔️ | ❌ | ❌ |
| Preformatted text | ✔️ | ✔️ | ✔️ |
| Blockquote | ✔️ | ✔️ | ✔️ |
| Hyperlink | ✔️ | ✔️ | ✔️ |
| Image link | ❌ | ❌ | ❌ |
AI-generated content messages
AI labels, citations, feedback buttons, and sensitivity labels in your agent’s messages improve user engagement and foster transparency and trust.
- AI label enables users to identify that the message was generated using AI.
- Citations enables users to refer to the source of the agent's message through in-text citations and references.
- Feedback buttons enables users to provide positive or negative feedback to the agent's messages.
- Sensitivity label enables users to understand the confidentiality of the agent's message.
For more information, see agent messages with AI-generated content.
Next step
See also
Platform Docs