npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@openstellar/tool-search

v0.2.2

Published

Tool search plugin for OpenCode — BM25 and regex search to discover tools on demand, reducing context usage

Readme

OpenStellar Tool Search

⚠️ Required: This plugin must be used with @openstellar/mcp-adapter to function.

Every tool has a name. Only you know what you need to do.

OpenCode defers tool descriptions to save context — the [d] tag is everywhere. Efficient, but the LLM goes blind. It calls the wrong tool, loads everything, or guesses.

Tool Search is the bridge. The LLM describes the job, not the name. You get BM25 + semantic search over tool IDs, descriptions, and parameter schemas — ranked results, with full descriptions, in one call.


What You Get

| Feature | What it does | Why it matters | | --- | --- | --- | | Semantic + BM25 search | Match the job against tool names, descriptions, and every nested parameter (filters.status, items[].id) | The LLM finds tools by capability, not by guessing names | | Regex precision | ^github.*create, mcp\|context, ^read$ — when you know the shape | Fast pinpoint lookup, no false positives | | Deferred descriptions | Keeps the first sentence of the original description followed by the configured suffix (e.g. [d]) | Saves prompt context tokens while leaving enough "information scent" for the LLM to locate tools on demand | | Lazy indexing | Zero cost on register. BM25 + embeddings built on first search only | Plugin does nothing until you ask. No startup tax. | | Self-contrasting tools | Each search tool tells the LLM when to use the other | No "which one do I call?" paralysis | | Local embeddings | @xenova/transformers runs MiniLM in-process | No API calls. No data leaves the machine. | | Auto-update | Checks npm registry on first session, invalidates stale cache, notifies you by toast | Always runs the latest version. No manual cleanup. |


Get Started

npm install -g @openstellar/tool-search

Add to opencode.jsonc:

{
  "plugin": [
    [
      "@openstellar/tool-search@latest",
      {
        "searchLimit": 5,
        "bm25": { "k1": 0.9, "b": 0.4 }
      }
    ]
  ]
}

tool_search and tool_search_regex are auto-included. No config needed.

Restart OpenCode. Tools get [d]. The LLM uses tool_search when it needs to know what they do.


How It Works

OpenCode tool.definition hook                  tool_search({ query: "create github issue" })
        │                                                   │
        ▼                                                   ▼
  Tool Vault  ────────  Lazy BM25 + Embeddings  ──────  Ranked hits
  (ID + desc + params)        (built on first search)     with full descriptions

Each tool registered gets its ID, description, and every nested parameter name indexed. Search returns the richest match — not just the first alphabetical hit.


Config

| Option | Type | Default | Description | | --- | --- | --- | --- | | alwaysLoad | string[] | [] | Tool IDs to never defer (tool_search and tool_search_regex are auto-added) | | searchLimit | number | 10 | Max results per search | | deferDescription | string | "[d]" | Placeholder used for deferred descriptions | | bm25.k1 | number | 0.9 | Term frequency saturation — higher = more weight on repeated terms | | bm25.b | number | 0.4 | Length normalization — 0 = none, 1 = full | | embedding.enabled | boolean | true | Use local semantic search via @xenova/transformers | | embedding.model | string | "Xenova/paraphrase-multilingual-MiniLM-L12-v2" | Any HuggingFace model supported by the transformers pipeline | | embedding.threshold | number | 0.3 | Base cosine similarity threshold for semantic hits; relaxed to 70% of this value when fewer than two hits qualify |


Architecture

src/
├── plugin.ts       — OpenCode hooks (tool.definition, system.transform, event)
├── vault.ts        — ToolVault (BM25 + semantic search engine)
├── matcher.ts      — SemanticMatcher (@xenova/transformers embeddings)
├── rank.ts         — RankEngine (BM25 tokenizer & scorer)
├── types.ts        — TypeScript types
└── hooks/
    └── auto-update-checker.ts  — npm registry version check + cache invalidation

Development

npm install
npm test          # 140 tests
npm run typecheck
npm run build

Smoke test the built tarball:

npm run smoke:plugin

Related Repositories


License

MIT © 2026 OpenStellar