Skip to main content
Glama

get_library_docs

Fetch library documentation by Context7 ID with an optional topic focus, so agents can answer coding questions using accurate API details.

Instructions

Get documentation for a library by its Context7 ID.

Args: library_id: The resolved library ID from resolve_library_id. topic: Optional focus area (e.g. "authentication", "routing").

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "library_id": "<library_id>"
    },
    "name": "get_library_docs"
  }
}

Input Schema

NameRequiredDescriptionDefault
topicNo
library_idYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv6.14.0

TDQS

A3.5/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden. 'Get' makes the read-only nature clear and the resolver dependency is disclosed, but nothing is said about documentation size, truncation/token limits, caching, or error behavior for an invalid ID — details that materially affect how an agent should call this 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?

The core purpose is front-loaded in one sentence, followed by a compact Args block that actually adds meaning rather than restating the schema. The docstring-style Args formatting is slightly verbose relative to the two-sentence content, but nothing is wasted.

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?

An output schema exists, so return values need not be described, and both parameters are covered. However, with no annotations and no statement about documentation volume or pagination, the definition leaves an agent without practical guidance on expected payload size for a documentation-fetch 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 0%, so the description must compensate, and it largely does: library_id is explained as the resolved ID from resolve_library_id, and topic is explained as an optional focus area with concrete examples ('authentication', 'routing'). It does not specify format constraints or expected ID shape, keeping it below 5.

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 documentation for a library by its Context7 ID.' The mention of Context7 ID plus the pointer to resolve_library_id distinguishes it from the sibling resolver tool, making the two-step fetch pipeline inferable. It stops short of an explicit contrast sentence, so a 4 rather than a 5.

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 note that library_id is 'the resolved library ID from resolve_library_id' tells the agent it must call the resolver first. There is no explicit when-to-use/when-not-to-use guidance or mention of what to do if the ID is unresolved or the topic is unknown.

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