Skip to main content
Glama

Resolve Library

gt_resolve_library
Read-onlyIdempotent

Resolves a library name to a Context7-compatible ID for documentation retrieval. Use this tool to obtain the correct identifier before accessing library docs.

Instructions

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

You MUST call this function before gt_get_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. For 2-20 libraries at once, use gt_batch_resolve instead.

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:

  1. Analyze the query to understand which library/package the user wants

  2. Pick the result with the highest score; on ties prefer source 'registry', then results that expose an llmsTxtUrl/llmsFullTxtUrl

  3. 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

TableJSON Schema
NameRequiredDescriptionDefault
queryNoOptional: what you want to do with this library, used to rank results
libraryNameYesLibrary or framework name to look up. Examples: 'nextjs', 'react', 'tailwind', 'fastapi', 'drizzle'
Behavior4/5

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

Annotations already convey safe, idempotent, read-only behavior. The description adds valuable context: the 3-call-per-question limit and a proprietary data notice. This exceeds annotations without contradiction.

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 comprehensive but lengthy, with sections that could be condensed. While well-structured, some parts (like the selection process and response format) are redundant with logical inference. It earns its place but is not optimally concise.

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

Completeness5/5

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

Given the tool's moderate complexity and absence of an output schema, the description is fully complete. It covers all necessary aspects: prerequisites, alternatives, selection logic, response format, and usage limits.

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 coverage is 100% and both parameters are well-described. The description reiterates the library name parameter and adds context about the query parameter's purpose, but does not significantly expand beyond schema details. Baseline 3 is appropriate.

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 tool's purpose: 'Resolve a package/product name to a Context7-compatible library ID and returns matching libraries.' It also explains its role relative to sibling tools like gt_get_docs and gt_batch_resolve, making it highly distinct.

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?

Explicit usage guidance is provided: 'You MUST call this function before gt_get_docs...' and 'For 2-20 libraries at once, use gt_batch_resolve instead.' The selection process and response format are detailed, leaving no ambiguity.

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/rm-rf-prod/ws-mcp'

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