Skip to main content
Glama

find_code_examples

Search fenced code blocks in documentation by natural language query, with optional language and document path filters. Returns matched block details for precise code retrieval.

Instructions

Search fenced code blocks across the indexed docs by BM25 over the block content. Returns one row per block with {block_id, section_id, doc_path, title, lang, byte_start, byte_end, snippet, _score}. Optional lang filter (e.g. 'python', 'bash') and doc_path/path_glob scope filters (applied before scoring, same contract as search_sections). Use after index_local; requires INDEX_VERSION>=3.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repoYesjdocmunch repo identifier
queryYesFree-form code-content query
langNoOptional case-insensitive language filter
doc_pathNoOptional exact-document scope: only blocks in the section with this doc_path
path_globNoOptional fnmatch glob (e.g. 'docs/api/**') scoping blocks to matching document paths
max_resultsNo
Behavior4/5

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

Describes BM25 scoring, return fields, and optional filters. No annotations provided, so description carries behavioral burden. It adequately conveys search behavior without side effects, though lacks depth on performance or data limits.

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

Conciseness5/5

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

Concise and well-structured. Front-loaded with main action, then details in a few sentences. No extraneous information; every sentence adds value.

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

Completeness5/5

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

With no output schema, description explicitly lists all return fields. Includes prerequisites and filtering behavior. Complete for an agent to correctly invoke the tool.

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

Parameters4/5

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

Schema description coverage is 83%, baseline 3. Description adds meaning: explains score, case-insensitive lang filter, and scope filters contract. Enhances understanding beyond schema definitions.

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

Purpose5/5

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

Description clearly states it searches fenced code blocks using BM25 over block content and lists specific return fields. It distinguishes from sibling tools like search_sections by specifying code blocks and BM25.

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?

Provides precondition 'Use after index_local; requires INDEX_VERSION>=3.' and mentions optional scope filters with same contract as search_sections. Lacks explicit when-not-to-use or direct comparison to alternatives, but context is clear.

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

Install Server

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/jgravelle/jdocmunch-mcp'

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