Skip to main content
Glama

Resolve Library

gt_resolve_library
Read-onlyIdempotent

Resolves 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:

  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
Behavior4/5

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

Annotations already indicate read-only, idempotent, non-destructive. The description adds that results may include llmsTxtUrl, ranking by score/source, and a proprietary data notice. This adds moderate behavioral context beyond 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 sections, bullet points, and clear headings. It is somewhat lengthy but each part serves a purpose. Minor redundancy in IMPORTANT notices.

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 of a lookup tool with multiple results and selection rules, the description covers purpose, usage, result structure, selection process, response format, error handling, and legal notice. No output schema, but output is thoroughly documented.

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 good descriptions for both parameters. The tool description adds examples and mentions query is for ranking, but these are minor additions. 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 resolves a package name to a Context7-compatible library ID, distinguishing it from siblings by requiring it before gt_get_docs and by specifying the output format. The verb 'resolve' and resource 'library ID' are specific.

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 (before gt_get_docs, unless library ID provided), when not to (ambiguous queries should request clarification), alternatives (gt_search), and a detailed selection process. Also includes a call limit of 3 per question.

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