Skip to main content
Glama

markdown_to_script

Extract language-tagged code from Markdown files, optionally converting prose to comments or including all fenced blocks.

Instructions

Extract code from a markdown file. Only fenced blocks tagged with language are kept unless extract_all_blocks is true. Prose becomes comments when include_prose is true.

Input Schema

NameRequiredDescriptionDefault
pathYes
languageYes
output_pathNo
include_proseNo
extract_all_blocksNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full behavioral burden. It does disclose the core filtering semantics of language tags and prose handling, which is genuinely useful. It omits side-effect details: whether output_path causes a file write, whether an existing file is overwritten, and whether the tool fails or returns empty when no blocks match.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three short sentences, no filler, and the core purpose is front-loaded before the flag semantics. Nothing redundant is included.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values need not be explained. But for a tool with an output_path that likely writes to disk, the absence of any note about writing behavior, overwrite risk, or failure modes leaves a meaningful gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the schema gives only names and types. The description compensates for three of five parameters (language, extract_all_blocks, include_prose) but says nothing about 'path' or 'output_path', so full compensation is not achieved.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Extract code from a markdown file'), which is enough to separate it from read_file and script_to_markdown. It does not name those siblings explicitly, so differentiation is left to inference.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains the conditional behavior (fenced blocks only unless extract_all_blocks, prose becomes comments when include_prose), which implies when each flag matters. However, it never says when to choose this over script_to_markdown or pandoc_convert, nor what happens with non-matching files.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.