Skip to main content
Glama

extract_code_blocks

Read-onlyIdempotent

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
markdownYesThe Markdown text to extract code blocks from.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/XJTLUmedia/MCP_Markdown_Formatter'

If you have feedback or need assistance with the MCP directory API, please join our Discord server