Skip to content

query-docs ​

Search indexed documentation using semantic search. Returns relevant code examples and explanations.

Example Prompts ​

This is the most common tool - just ask any documentation question naturally:

"How do I set up middleware in Hono?"

"Show me examples of Drizzle ORM relations"

"What's the correct way to handle errors in TanStack Query?"

"How do I create a protected route in Next.js App Router?"

"Explain React Server Components data fetching patterns"

The AI will automatically find the right library and search its documentation.

Usage ​

Tool: query-docs
Parameters:
  - libraryId (required): The library ID from resolve-library
  - query (required): Your question or what you're looking for
  - limit (optional): Max results (1-10, default 5)
  - tokens (optional): Response format for token efficiency

Example ​

Input:

json
{
  "libraryId": "react",
  "query": "useEffect cleanup function best practices",
  "limit": 3
}

Output:

json
{
  "results": [
    {
      "title": "Cleaning up Effects",
      "content": "Return a cleanup function from your Effect to handle...",
      "source": "react.dev/reference/react/useEffect",
      "relevance": 0.95
    }
  ]
}

Parameters ​

ParameterTypeRequiredDescription
libraryIdstringYesLibrary ID from resolve-library
querystringYesWhat you're looking for
limitnumberNoMax results 1-10, default 5
tokensstringNoResponse format: full, compact, code-only, summary

Token Formats ​

FormatDescription
fullComplete response with metadata (default)
compactEssential data only
code-onlyOnly code blocks
summaryBrief overview

Returns ​

An array of search results with:

  • title - Section or page title
  • content - Relevant documentation text
  • code - Code examples if available
  • source - Original documentation URL
  • relevance - Relevance score 0-1

Tips ​

  • Be specific: "useEffect cleanup" > "useEffect"
  • Include context: "authentication with JWT in Express"
  • Use code-only format when you just need examples

Released under the MIT License.