extract_code_blocks
Extract code blocks from Markdown documents to parse AI responses and technical docs. Returns JSON arrays containing programming languages, source code, and start/end line numbers.
Instructions
Extract all code blocks from a Markdown document. Returns a JSON array of code blocks, each with language, code content, and start/end line numbers. Useful for extracting code snippets from LLM responses or documentation.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"markdown": "<markdown>"
},
"name": "extract_code_blocks"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| markdown | Yes | The Markdown text to extract code blocks from. |