Skip to main content
Glama

queryDocs

Read-onlyIdempotent

Retrieve official library documentation, API references, and code snippets by package name or question, with fallback to npm/PyPI registries and GitHub READMEs when needed.

Instructions

Get official docs, API references, and code snippets for libraries/packages (e.g. 'react', 'fastapi', 'next.js'). Queries Context7 with fallback to npm/PyPI registry and GitHub README. Direct, no proxy needed.

Input Schema

NameRequiredDescriptionDefault
cacheNoUse the 24h local docs cache (default) or bypass/refresh it with 'reload'
limitNoMaximum number of code snippets to return (default 5)
queryNoThe question, feature, or task to get relevant documentation for (optional; defaults to an overview when omitted, e.g. 'how to set up middleware with auth')
strictNoIf true, rejects low-confidence library name matches with an error instead of returning loosely matched candidate docs (default false)
libraryNoLibrary or package name (e.g. 'next.js', 'react', 'fastapi') or exact Context7 library ID (e.g. '/vercel/next.js', version-pinnable like '/vercel/next.js@v15.1.8')
versionNoOptional explicit version (e.g. '14.2.0' or 'v15.1.8'); overrides an @version embedded in library
libraryIdNoLegacy alias for library (e.g. /vercel/next.js)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.5.1
    • changedInput schema / additionalProperties
      Previous value: -trueNew value: +{}
  2. Changed4 schema fields changedv1.3.10
    • changedInput schema / additionalProperties
      Previous value: -falseNew value: +true
    • addedInput schema / properties / cache
      Added value: +{
      +  "description": "Use the 24h local docs cache (default) or bypass/refresh it with 'reload'",
      +  "enum": [
      +    "default",
      +    "reload"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / strict
      Added value: +{
      +  "description": "If true, rejects low-confidence library name matches with an error instead of returning loosely matched candidate docs (default false)",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / version
      Added value: +{
      +  "description": "Optional explicit version (e.g. '14.2.0' or 'v15.1.8'); overrides an @version embedded in library",
      +  "minLength": 1,
      +  "type": "string"
      +}
  3. Changed1 schema field changedv1.3.1
    • removedInput schema / required
      Removed value: -[
      -  "library"
      -]
  4. Changed4 schema fields changedv1.2.1
    • addedInput schema / properties / library
      Added value: +{
      +  "description": "Library or package name (e.g. 'next.js', 'react', 'fastapi') or exact Context7 library ID (e.g. '/vercel/next.js', version-pinnable like '/vercel/next.js@v15.1.8')",
      +  "minLength": 1,
      +  "type": "string"
      +}
    • changedInput schema / properties / libraryId / description
      Previous value: -"Exact Context7-compatible library ID (e.g. /vercel/next.js, /packages/express; optional version like /vercel/next.js@v15.1.8)"New value: +"Legacy alias for library (e.g. /vercel/next.js)"
    • changedInput schema / properties / query / description
      Previous value: -"The question or task to get relevant documentation for (optional; defaults to an overview when omitted, e.g. 'how to set up middleware with auth')"New value: +"The question, feature, or task to get relevant documentation for (optional; defaults to an overview when omitted, e.g. 'how to set up middleware with auth')"
    • changedInput schema / required
      Previous value: -[
      -  "libraryId"
      -]New value: +[
      +  "library"
      +]
  5. First observedv1.0.11

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare readOnly, idempotent, non-destructive, and openWorld, so the safety profile is covered. The description adds genuinely new behavior: a prioritized source chain (Context7 primary, then npm/PyPI registry, then GitHub README) and that it connects directly with no proxy. With annotations carrying most of the burden, this extra sourcing context earns a 3 rather than a 4, since it says nothing about latency, rate limits, or what a fallback result looks like.

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, front-loaded with the core purpose before the source/fallback detail. Minor waste: 'Direct, no proxy needed' is vague and an agent cannot act on it.

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?

With seven optional parameters and no output schema, the description does at least say what kind of content comes back (docs, API references, code snippets). But it leaves the fallback behavior undefined from the caller's perspective, does not explain how multiple sources are merged or ordered in the response, and gives no steer on typical parameter combinations.

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 100%, and every parameter (cache, limit, query, strict, library, version, libraryId) is documented at the field level. The description only echoes the library examples already in the schema and adds no meaning for cache, strict, limit, or the libraryId alias, so the baseline 3 applies.

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 ('Get official docs, API references, and code snippets') scoped to libraries/packages with concrete examples ('react', 'fastapi', 'next.js'). It implicitly separates itself from fetchWebContent and fetchGithubContent by naming its own source chain (Context7, npm/PyPI registry, GitHub README), though it never names the siblings outright.

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?

Usage is implied rather than stated: the agent can infer this is for library/package documentation lookups, and the source-fallback chain hints at why it may succeed where a plain web fetch fails. There is no explicit when-to-use vs when-not-to-use guidance relative to search, fetchWebContent, fetchGithubContent, or codeSymbol.

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