Skip to main content
Glama

Search npm packages

npm_packages_search
Read-onlyIdempotent

Search the npm registry by words and qualifiers, ranked by npm's search score; a page past the results is empty. Requires query. Returns a list (use cursor when paginated). Costs credits; see meta.creditsCharged.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "query": "<query>",
      "context": "<context>",
      "llm_model": "<llm_model>"
    },
    "name": "npm_packages_search"
  }
}

Input Schema

NameRequiredDescriptionDefault
pageNo1-based page number. The registry accepts a starting offset only up to 5000, so a page past the reachable results is an empty page. Default: 1.
sortNoRanking: `optimal` (npm's blend), or a single component. Default: `optimal`.
limitNoResults per page, 1 to 250. Default: 20.
queryYesRequired. Search text, 2 to 64 characters. A single emoji counts as two characters. The registry's qualifiers work: `author:isaacs`, `maintainer:`, `keywords:a,b`, `not:deprecated`, `@scope`.
cursorNoCursor from `page.nextCursor` of the previous response. It only continues the same lookup and filters.
contextYesDescribe the user's underlying goal in one sentence, not the tool you are calling.
qualityNoQuality weight, 0 to 1.
llm_modelYesThe exact model identifier you (the assistant) are running as, taken from your system prompt or environment (for example "claude-opus-4-8" or "gpt-5.2"). Used for analytics only. If you do not know your model identifier with certainty, pass "unknown" and do not guess.
popularityNoPopularity weight, 0 to 1.
maintenanceNoMaintenance weight, 0 to 1.
conversation_idNoEcho the conversation_id from the server's previous response. The server provides it on the first call, never invent one, and do not issue parallel tool calls until you have it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already cover read-only, open-world, idempotent and non-destructive traits, yet the description still adds real context: ranking basis, empty-page behavior past reachable results, credit cost via meta.creditsCharged, and cursor continuity. It does not describe result fields or pagination limits beyond the empty-page note.

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?

Compact and front-loaded: what it searches, how it ranks, the required param, the return shape, then cost. The parenthetical cursor remark is slightly redundant with the schema but does not bloat the text.

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

Completeness4/5

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

For an 11-parameter, credit-charging search tool with no output schema, the description covers the essentials: required input, pagination behavior, result shape and cost disclosure. It could say more about what fields each result carries, but annotations and a fully documented schema carry the rest.

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%, so every parameter including query, cursor, page, sort and the weight fields is already documented in the schema. The description only restates the query requirement and cursor usage, adding no syntax or format detail the schema lacks beyond the credit note.

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?

States a specific verb and resource ('Search the npm registry'), plus scope details (words and qualifiers) and the ranking model (npm's search score). An agent can distinguish it from the sibling list/get tools without opening a schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives actionable conditions ('Requires query', 'a page past the results is empty', 'use cursor when paginated') but never explicitly contrasts with alternatives such as the registry list or package-get tools. Usage is implied rather than routed, so an agent must infer when search beats listing.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.