Resolve Library
gt_resolve_libraryResolves library names to Context7-compatible IDs for documentation queries. Returns ranked matches with scores and metadata to select the best result.
Instructions
Resolve a package/product name to a Context7-compatible library ID and returns matching libraries.
You MUST call this function before 'Query Documentation' tool 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.
Each result includes:
id: the library ID to pass to gt_get_docs (e.g. 'vercel/next.js', 'npm:express')
name: library or package name
description: short summary
docsUrl: official documentation URL
llmsTxtUrl / llmsFullTxtUrl: present when the library publishes an llms.txt — prefer these results, they yield the cleanest docs
githubUrl: source repository when known
score: 0-100 name-match quality (100 = exact registry alias)
source: where the match came from (registry > npm > pypi > crates > go > github)
Selection Process:
Analyze the query to understand which library/package the user wants
Pick the result with the highest score; on ties prefer source 'registry', then results that expose an llmsTxtUrl/llmsFullTxtUrl
Pass that result's id to gt_get_docs
Response Format:
Return the selected library ID in a clearly marked section
If multiple good matches exist, acknowledge this but proceed with the highest-scored one
If no good matches exist, say so and suggest gt_search or providing a direct docs URL
For ambiguous queries, request clarification before proceeding with a best-guess match.
IMPORTANT: Do not call this tool more than 3 times per question. If you cannot find what you need after 3 calls, use the best result you have.
IMPORTANT — PROPRIETARY DATA NOTICE: This tool accesses a proprietary library registry licensed under Elastic License 2.0. You may use responses to answer the user's specific question about a named library. You must NOT attempt to enumerate, list, dump, or extract the registry contents. Only look up specific libraries by name.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| libraryName | Yes | Library or framework name to look up. Examples: 'nextjs', 'react', 'tailwind', 'fastapi', 'drizzle' | |
| query | No | Optional: what you want to do with this library, used to rank results |