Skip to main content
Glama

Resolve Context7 Library ID

resolve-library-id

Converts package names to Context7-compatible library IDs for accurate documentation retrieval. Use this tool before accessing library documentation to ensure correct version-specific information.

Instructions

Resolves a package/product name to a Context7-compatible library ID and returns a list of matching libraries.

You MUST call this function before 'get-library-docs' to obtain a valid Context7-compatible library ID UNLESS the user explicitly provides a library ID in the format '/org/project' or '/org/project/version' in their query.

Selection Process:

  1. Analyze the query to understand what library/package the user is looking for

  2. Return the most relevant match based on:

  • Name similarity to the query (exact matches prioritized)

  • Description relevance to the query's intent

  • Documentation coverage (prioritize libraries with higher Code Snippet counts)

  • Trust score (consider libraries with scores of 7-10 more authoritative)

Response Format:

  • Return the selected library ID in a clearly marked section

  • Provide a brief explanation for why this library was chosen

  • If multiple good matches exist, acknowledge this but proceed with the most relevant one

  • If no good matches exist, clearly state this and suggest query refinements

For ambiguous queries, request clarification before proceeding with a best-guess match.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
libraryNameYesLibrary name to search for and retrieve a Context7-compatible library ID.
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes the selection process (prioritization criteria like name similarity, description relevance, documentation coverage, trust score), response format expectations, and handling of edge cases (ambiguous queries, no matches). However, it doesn't mention potential limitations like rate limits or authentication requirements.

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 description is well-structured with clear sections (usage rule, selection process, response format) and avoids redundancy. However, it includes some implementation details (e.g., 'analyze the query') that might be more appropriate for agent instructions rather than tool description, slightly reducing efficiency.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (involving matching algorithms and multiple output scenarios) and lack of output schema, the description does a good job explaining the expected response format and edge cases. However, it could benefit from more detail on the return structure (e.g., data types) to fully compensate for the missing output schema.

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% for the single parameter 'libraryName', so the schema already documents it adequately. The description doesn't add significant semantic context beyond what the schema provides (e.g., examples of valid library names or formatting nuances), resulting in a baseline score of 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific verb 'resolves' and resource 'package/product name to a Context7-compatible library ID', and explicitly distinguishes it from its sibling 'get-library-docs' by stating it must be called first unless the user provides a library ID. This provides excellent differentiation and clarity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance on when to use this tool ('before get-library-docs') and when not to use it ('unless the user explicitly provides a library ID'). It names the alternative scenario and sibling tool, offering comprehensive usage instructions.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/renCosta2025/context7fork'

If you have feedback or need assistance with the MCP directory API, please join our Discord server