Skip to main content
Glama

extract_code_snippets

Extract a structured inventory of fenced code snippets from documentation, including language, line numbers, source URLs, and code. Use it to verify snippets and design documentation CI.

Instructions

Return an inventory of fenced code snippets from the documentation.

The result includes the doc key, title, heading, language, line number, source URL, and code. Use this for snippet verification and docs CI design.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyNo
languageNo
max_snippetsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Install Server

TDQS

B3.1/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 the full burden of behavioral disclosure. It clarifies that the tool returns an inventory and lists the included fields such as doc key, title, heading, language, line number, source URL, and code. It does not address filtering behavior, output limits, or empty-result handling.

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?

The description is compact and front-loaded with the core purpose. The result-field list and the use-case sentence add useful context without unnecessary repetition or filler.

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

Completeness2/5

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

The tool has three optional parameters, no annotations, and an output schema, yet the description leaves parameter semantics unexplained and does not guide selection versus sibling tools. The purpose and result contents are covered, but an agent still lacks critical information needed to invoke the tool effectively.

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

Parameters1/5

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

Schema description coverage is 0%, and the description does not explain any of the three parameters: key, language, or max_snippets. The word 'language' appears only in the result-field list, which does not help an agent understand how to populate the language parameter correctly.

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?

The description states a specific verb ('Return an inventory') and a distinct resource ('fenced code snippets from the documentation'), making the tool's main function clear. It does not explicitly contrast with sibling tools such as find_examples, but the fenced-snippet inventory scope is sufficiently distinct.

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

Usage Guidelines4/5

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

The description names concrete use cases: 'snippet verification and docs CI design.' However, it does not state when not to use this tool or name alternatives like find_examples, so it provides clear context but no exclusionary guidance.

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

Other Tools

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/justinmclean/IggyDocMCP'

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