Skip to main content
Glama

docs_query

Queries Context7 documentation by library ID to retrieve relevant API details and usage guidance; supports query terms and token limits for focused results.

Instructions

Query Context7 docs for a library. Uses Context7 API when CONTEXT7_API_KEY is set. libraryId (from docs_resolve_id), query, tokens optional.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "docs_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
typeNo
queryNo
tokensNo
libraryIdNo
cacheToMemoryNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.0

TDQS

B3.1/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full burden; it does disclose a meaningful behavioral trait, that the Context7 API is used only when CONTEXT7_API_KEY is set, which implies fallback behavior. It omits what happens without the key, whether results are cached, and whether responses are large or paginated, gaps that matter for a docs-fetching tool.

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?

Two compact sentences with the core action front-loaded and no filler. It is terse rather than padded, though the terseness arguably costs information rather than clarity.

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?

For a 5-parameter tool with zero schema coverage, no annotations, and no output schema, the description is too thin: two parameters are never mentioned, and the return shape and failure modes when the API key is absent are left unspecified.

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

Parameters2/5

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

Schema description coverage is 0% across 5 parameters, so the description must compensate. It covers only libraryId (with provenance), query, and tokens; 'type' and 'cacheToMemory' are completely undocumented in both schema and description, leaving an agent guessing about result-type filtering and memory caching.

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?

"Query Context7 docs for a library" gives a specific verb and resource, and naming docs_resolve_id as the source of libraryId distinguishes it from that sibling. However, it doesn't distinguish it from other retrieval-style siblings such as memory_retrieve or the agent tools.

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?

The definition implies the flow: get libraryId from docs_resolve_id, then call this. It doesn't explicitly say when to use this versus docs_resolve_id on its own, or when not to query docs at all.

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