Tool tree
Generate downloadable code snippets with syntax highlighting.
Implementation
gradeNot graded
gradeNot graded
set_codeAction
Set the complete source code shown in the code image editor. Use this whenever the user supplies code they want displayed, changed, rendered, or captured. It may run in parallel with set_code_options; both must succeed before capture_code.
View tool JSON
{
"name": "set_code",
"kind": "act",
"impl": "imperative",
"description": "Set the complete source code shown in the code image editor. Use this whenever the user supplies code they want displayed, changed, rendered, or captured. It may run in parallel with set_code_options; both must succeed before capture_code.",
"inputSchema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "The complete replacement source code to display. Preserve the user-provided text exactly, including whitespace and line breaks."
}
},
"required": [
"code"
],
"additionalProperties": false
}
}set_code_optionsAction
Set one or more visual options for the current code: language, canvas size, background gradient, title, or watermark. Use only for options the user explicitly requests. It may run in parallel with set_code; both must succeed before capture_code.
View tool JSON
{
"name": "set_code_options",
"kind": "act",
"impl": "imperative",
"description": "Set one or more visual options for the current code: language, canvas size, background gradient, title, or watermark. Use only for options the user explicitly requests. It may run in parallel with set_code; both must succeed before capture_code.",
"inputSchema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"language": {
"description": "Syntax-highlighting language for the code image.",
"type": "string",
"enum": [
"typescript",
"markdown",
"php",
"json",
"vue",
"html"
]
},
"size": {
"description": "Canvas size for the code image.",
"type": "string",
"enum": [
"sm",
"md",
"lg",
"xl"
]
},
"gradient": {
"description": "Background gradient for the code image.",
"type": "string",
"enum": [
"purple",
"blue",
"green",
"orange",
"pink",
"red",
"sunset",
"midnight",
"aurora",
"lagoon"
]
},
"title": {
"description": "Title displayed above the code. Use an empty string to remove it.",
"type": "string"
},
"watermark": {
"description": "Watermark displayed below the code. Use an empty string to remove it.",
"type": "string"
}
},
"additionalProperties": false
}
}capture_codeAction
Capture and download the current code as screenshot.png.
View tool JSON
{
"name": "capture_code",
"kind": "act",
"impl": "imperative",
"description": "Capture and download the current code as screenshot.png.",
"inputSchema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {},
"additionalProperties": false
}
}