Internal
Code block
Create a syntax-highlighted code block from a snippet of source code.
Send "type": "code_block".
Create a syntax-highlighted code block from a snippet of source code.
Also available as the MCP tool render_codeblock. The same payload works through either surface.
Fields
codestringrequiredRaw source code. Preserve newlines and indentation exactly.
languagestringProgramming language, lowercase (e.g. "javascript", "python", "sql", "bash")
titlestringShort title for the code block title bar (e.g. "Bubble Sort")
Example
{
"type": "code_block",
"data": {
"code": "string",
"language": "string",
"title": "Q4 Launch Planning"
}
}
Was this page helpful?