Skip to main content

Code Block Tools

These 4 tools work with code blocks inside markdown documentation — fenced code blocks that show examples, usage patterns, and configuration snippets. They do not work with source code files (use Code Tools for that).

info

These tools require the docs graph to be enabled.

docs_find_examples

Finds code blocks in documentation that mention a specific symbol.

Parameters

ParameterRequiredDefaultDescription
symbolYesSymbol name to search for (e.g. "UserService", "createApp")
limitNo20Maximum results to return

Returns

Array of { id, fileId, language, symbols, content, parentId, parentTitle } — each entry is a code block that references the symbol, along with the parent documentation section it appears in.

When to use

When you want to see how a symbol is used in documentation examples. For instance: "Show me examples of how UserService is used in the docs."


docs_search_snippets

Semantic search over code blocks extracted from documentation.

Parameters

ParameterRequiredDefaultDescription
queryYesSearch query (natural language)
topKNo10Maximum results
minScoreNo0.3Minimum relevance score
languageNoFilter by language (e.g. "typescript", "python")

Returns

Array of { id, fileId, language, symbols, content, score } — matching code blocks ranked by relevance.

When to use

When you want to find code examples by what they do, not just which symbols they contain. For instance: "Find examples of error handling middleware."


docs_list_snippets

Lists code blocks with optional filters.

Parameters

ParameterRequiredDefaultDescription
fileIdNoFilter by documentation file
languageNoFilter by language (e.g. "typescript")
filterNoSubstring match on code content
limitNo20Maximum results to return

Returns

Array of { id, fileId, language, symbols, preview } — each entry includes a short preview of the code block.

When to use

Browsing all code examples in documentation, optionally narrowed by language or file.


docs_explain_symbol

Finds a code example for a symbol along with its surrounding prose explanation.

Parameters

ParameterRequiredDefaultDescription
symbolYesSymbol name to look up
limitNo10Maximum results to return

Returns

Array of { codeBlock, explanation, fileId } — each entry contains a code block referencing the symbol and the text section that explains it.

When to use

When you want to understand how a symbol works with both its code example and the documentation that explains it. This is more informative than docs_find_examples because it includes the prose context.