Skip to main content
Glama

Resolve Library

gt_resolve_library
Read-onlyIdempotent

Resolves a package or product name to a library ID, enabling documentation lookup. Selects the best match based on name quality and available sources.

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?

Beyond annotations (readOnlyHint, idempotentHint), the description adds significant behavioral context: it accesses a proprietary registry, prohibits enumeration, limits calls to 3 per question, explains result ranking (score, source, llmsTxtUrl preference), and details the selection process. 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 long but well-structured with clear sections (Selection Process, Response Format, Important notices), and the main purpose is front-loaded. While slightly verbose, the detail is justified for a critical workflow tool.

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 complexity, lack of output schema, and multiple siblings, the description is remarkably complete. It covers return fields, selection criteria, error handling ('no good matches'), fallback suggestions, usage limits, and proprietary data constraints.

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% with descriptions for both parameters. The description does not add substantial new parameter-level details beyond the schema; it focuses on usage and output. Baseline score of 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 resolves a package/product name to a Context7-compatible library ID and returns matching libraries. It explicitly distinguishes itself from sibling tools like gt_get_docs and gt_search, and provides a detailed selection process that differentiates its role.

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 explicitly states when to use this tool ('MUST call this function before 'Query Documentation' tool') and when not to ('UNLESS the user explicitly provides a library ID'). It also mentions alternatives like gt_search for cases with no matches.

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/GroundTruth-MCP'

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