Skip to main content
Glama

Resolve Library

gt_resolve_library
Read-onlyIdempotent

Resolve a package or product name to a Context7-compatible library ID and get matching libraries with metadata, enabling accurate documentation queries.

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:

  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
libraryNameYesLibrary or framework name to look up. Examples: 'nextjs', 'react', 'tailwind', 'fastapi', 'drizzle'
queryNoOptional: what you want to do with this library, used to rank results
Behavior5/5

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

Annotations already indicate read-only, idempotent, and open-world behavior. The description adds critical behavioral constraints: it accesses a proprietary registry under Elastic License 2.0, prohibits enumeration or extraction, and explains when results with llmsTxtUrl are preferred. There is no contradiction with annotations.

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 (purpose, result fields, selection process, response format, important notes). It is front-loaded with the most critical instruction. However, it is somewhat verbose, with some redundancy in the selection process description.

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?

Despite lacking an output schema, the description thoroughly details the response fields (id, name, description, etc.) and the selection criteria. It covers edge cases like multiple matches and ambiguous queries, and includes a proprietary data notice. This ensures the agent has complete context to use the tool effectively.

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 coverage is 100% with both parameters described. The description adds value by explaining that the optional 'query' parameter is used for ranking results, and provides concrete examples for 'libraryName'. This goes beyond the schema's basic descriptions.

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 resolves a package/product name to a Context7-compatible library ID. It explicitly distinguishes itself from siblings like gt_get_docs by stating it must be called before documentation queries, and from gt_search by focusing on name resolution rather than general search.

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 usage guidelines: required before gt_get_docs unless the user provides a library ID, limit of 3 calls per question, and handling of ambiguous queries by requesting clarification. It also describes a detailed selection process for choosing the best match among results.

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