Skip to main content
Glama

resolve-library-id

resolve-library-id

Resolves package names to Context7-compatible library IDs for documentation lookup. Use this tool to convert library names into the required format before accessing documentation.

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)

  • Source reputation (consider libraries with High or Medium reputation more authoritative)

  • Benchmark Score: Quality indicator (100 is the highest score)

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
libraryNameYes
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 tool's behavior: it returns a list of matching libraries, explains the selection process with prioritization criteria (name similarity, description relevance, etc.), specifies the response format (including error handling for no matches), and outlines how to handle ambiguous queries. This covers most behavioral aspects, though it could mention performance characteristics like rate limits or authentication needs.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized but not optimally structured. The first paragraph clearly states the purpose and usage guidelines, but the subsequent 'Selection Process' and 'Response Format' sections, while informative, could be more integrated. Some sentences (e.g., about benchmark scores) add value but slightly reduce conciseness. Overall, it's front-loaded with key information but includes some elaboration that, while useful, affects 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 complexity (a resolution tool with a multi-criteria selection process), no annotations, and no output schema, the description does a good job of covering context. It explains the tool's role in the workflow, the selection logic, and the response handling. However, it lacks details on output structure (beyond high-level format) and doesn't address potential errors or edge cases beyond 'no good matches,' leaving minor gaps in completeness.

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?

The schema description coverage is 0%, so the description must compensate. It adds significant meaning beyond the bare schema by explaining that the 'libraryName' parameter is a 'package/product name' to be resolved, and it implicitly defines the expected input as a query string rather than a pre-formatted ID. However, it doesn't provide examples or format details for the parameter, leaving some ambiguity.

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 action ('resolves a package/product name to a Context7-compatible library ID') and resource ('returns a list of matching libraries'), distinguishing it from its sibling 'get-library-docs' by explaining this is a prerequisite step for obtaining valid IDs. The verb 'resolves' is precise and the scope is well-defined.

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?

Explicitly states when to use this tool ('before get-library-docs to obtain a valid Context7-compatible library ID') and when not to use it ('UNLESS the user explicitly provides a library ID in the format...'). It names the alternative tool ('get-library-docs') and provides clear conditions for bypassing this tool, offering comprehensive guidance.

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/xiaobenyang-com/context7-mcp'

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