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

pi-tool-search

v0.3.6

Published

Hide all tools behind a manifest-aware tool_search — LLM enables tools by name on demand

Downloads

919

Readme

pi-tool-search

Hide non-core tools behind a manifest-aware tool_search gate. Core tools stay enabled by default; everything else can be unlocked on demand. Purpose: reduce prompt context / token usage by avoiding full tool schemas for rarely used tools.

Why

Full tool schemas are expensive (~500 bytes each). With 50 tools that's ~25KB of schema noise every turn. Purpose of this extension is to reduce prompt context / token usage: keep core tools active, replace rest with compact manifest in tool_search, and only load full schemas when explicitly unlocked.

How it works

  • session_start — snapshots all tools into compact manifest, seeds unlocked set with core tools enabled by default (read, write, edit, bash, grep, find)
  • turn_start — rebuilds manifest before every LLM call, re-registers tool_search with fresh description, re-applies active tools for agent-loop continuations too
  • tool_search.execute — validates names, adds to unlocked set, persists across turns, queues hidden steer hint so agent can continue without waiting for another user message

What the LLM sees

Pi's system prompt includes a lightweight tool index — names and one-liners for every registered tool. This is intentional: the LLM needs to know what tools exist so it can make targeted tool_search requests rather than guessing. The index costs ~4KB regardless of tool count; full schemas are never sent until unlocked.

The tool_search description itself carries the same manifest, reinforcing which tools are available and how to unlock them:

Enable tools by name before calling them. All tools below are hidden until you enable them here.

Available tools:
  read: Read file contents with optional offset/limit
  write: Write content to a file
  bash: Execute a shell command
  grep: Search files with ripgrep
  ...

Pass one or more exact tool names. After enabling, call those tools directly in next turn.

Install

pi install npm:pi-tool-search

Or configure manually in settings.json:

{
  "extensions": ["/path/to/pi-tool-search"]
}

Usage

Once installed, all tools except core defaults (read, write, edit, bash, grep, find) are hidden behind tool_search. Call tool_search with tool names to unlock them on demand.

Configuration

Add a toolSearch block to settings.json:

{
  "toolSearch": {
    "alwaysEnabled": ["lsp", "grep", "find"],
    "showToolSearchFooterStatus": true
  }
}

| Key | Default | Description | |---|---|---| | alwaysEnabled | [] | Tool names to pre-unlock beyond default core tools (read, write, edit, bash, grep, find) | | showToolSearchFooterStatus | true | Show tool-search N / total tools in the footer status bar |

Unknown names in alwaysEnabled are silently ignored until they appear in manifest. alwaysEnabled is read at each session_start, so changes take effect on next session without reinstall. showToolSearchFooterStatus is re-read on refresh; set it to false to clear/hide the tool-search footer status.

Same-response activation caveat

If model emits tool_search(...) and newly enabled tool in same assistant response, second call can still fail because provider already received old tool schema for that response. Extension now mitigates this by:

  • telling model to call tool_search alone
  • re-applying active tools on every turn_start
  • queueing hidden steer hint after successful enable so agent can retry in next turn without waiting for another user message

Result: failure no longer needs fresh user message to recover. Retry can happen in immediate next agent turn.