Skip to main content
Glama

pkg_search

Read-onlyIdempotent

Search NuGet, npm, or PyPI by keyword to discover or confirm a package ID when the exact name is unknown, then use the returned lookup step to inspect the hit.

Instructions

Finds a package when you do not know its exact id. Each hit: id, latest version, download count when the registry gives one, and a one-line description; the reply ends with the pkg_find call to make next. Reads the public registry and changes nothing. How each ecosystem searches: NuGet (default) searches nuget.org by keyword. npm (ecosystem='npm') searches the npm registry by keyword. PyPI (ecosystem='pypi') has no search, so the query is tried as project names: the words joined with '-', then each word alone; only projects that exist come back, and none means no project has that name. WHEN TO USE: only to discover or confirm a package id. Skip it when the id is already in the project's package list or lock file and go straight to pkg_find; for the namespaces or modules of a known package use pkg_outline.

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>"
    },
    "name": "pkg_search"
  }
}

Input Schema

NameRequiredDescriptionDefault
takeNoOptional: number of packages to return (default 5, max 8)
guideNotrue: put the packages guide first in the result. Use on your first packages call, or when told it changed.
queryYesNuGet and npm: keywords or a name ('polly retry', 'react query'). PyPI: the project name as in 'pip install name' ('requests'); words are joined with '-' ('scikit learn' tries scikit-learn).
ecosystemNoOptional: 'nuget' (default), 'pypi' (a Python package) or 'npm' (a JavaScript or TypeScript package).
includePrereleaseNoOptional: include prerelease versions (default false; NuGet only)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.2.2
    • changedInput schema / properties / query / description
      Previous value: -"Package name or keyword (e.g. 'openai', 'polly retry'; for pypi the project name, e.g. 'requests' or 'scikit learn'; for npm words such as 'react query')"New value: +"NuGet and npm: keywords or a name ('polly retry', 'react query'). PyPI: the project name as in 'pip install name' ('requests'); words are joined with '-' ('scikit learn' tries scikit-learn)."
  2. First observedv0.2.0

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint and destructiveHint=false, so 'reads the public registry and changes nothing' adds nothing on the safety axis. What does add value is the non-obvious ecosystem behavior: PyPI has no search at all and silently degrades to guessing project names via joined words then single words, which is a real behavioral surprise an agent must anticipate. The reply shape (id, latest version, download count when available, one-line description) and the declared follow-up call are also disclosed, though with no output schema a slightly fuller description of hit ordering/relevance would help.

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 front-loaded with purpose, then per-ecosystem mechanics, then a labeled WHEN TO USE block — a sensible order for scanning. It is on the long side and one clause ('Reads the public registry and changes nothing') merely restates the annotations, but the remainder earns its space.

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?

With no output schema, the description carries the burden of describing returns, and it does: it enumerates each hit's fields and notes the trailing pkg_find call, so an agent knows what comes back and what to do next. Combined with the ecosystem-specific search semantics and clear routing guidance, nothing an agent needs to invoke this correctly is missing.

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%, so the baseline is 3 and the parameters are already documented. The description goes beyond the schema by explaining the per-ecosystem interpretation of `query` (npm/nuget keyword vs PyPI exact-project-name attempts with '-' joining) and the consequence that a PyPI miss means no project has that name, which constrains how an agent should phrase queries. It does not add anything for `take`, `guide` or `includePrerelease` beyond what the schema states.

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 opening sentence names a specific verb and resource ('Finds a package') and immediately scopes it to the case where the exact id is unknown, which is exactly what separates it from pkg_find. A reader can distinguish it from pkg_find and pkg_outline without opening any schema.

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?

It contains an explicit WHEN TO USE block: 'only to discover or confirm a package id', plus a negative rule ('Skip it when the id is already in the project's package list or lock file and go straight to pkg_find') and a third routing rule to pkg_outline for namespaces/modules. When-to-use, when-not-to-use and the named alternatives are all present.

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