@narumitw/pi-web-search

Pi package that adds a web_search tool backed by Brave Search or DuckDuckGo HTML.

Package details

extension

Install @narumitw/pi-web-search from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@narumitw/pi-web-search
Package
@narumitw/pi-web-search
Version
0.1.3
Published
May 4, 2026
Downloads
not available
Author
narumitw
License
MIT
Types
extension
Size
12.4 KB
Dependencies
0 dependencies · 3 peers
Pi manifest JSON
{
  "extensions": [
    "./extensions"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

pi-web-search

A shareable pi package that adds a web_search tool.

The tool searches the web and returns ranked results with titles, URLs, and snippets. It can use Brave Search when an API key is available, or DuckDuckGo HTML without an API key.

Install

Install directly from git:

pi install git:github.com/narumiruna/pi-web-search

Or install from a local checkout:

pi install /absolute/path/to/pi-web-search
# or, for this project only:
pi install -l ./pi-web-search

If published to npm, install with:

pi install npm:@narumitw/pi-web-search

To try it for one run without adding it to settings:

pi -e git:github.com/narumiruna/pi-web-search
# or
pi -e /absolute/path/to/pi-web-search

Security note: pi packages can execute code with your user permissions. Review packages before installing them.

Tool

web_search searches the web and returns source URLs with snippets.

Parameters:

  • query (string, required): search query
  • max_results (integer, optional): number of results, 1-10, defaults to 5
  • provider (auto | brave | duckduckgo, optional): defaults to auto
  • safe_search (boolean, optional): defaults to true

Providers

  • auto: uses Brave Search when BRAVE_SEARCH_API_KEY is set; otherwise uses DuckDuckGo HTML.

  • brave: uses the Brave Search API and requires:

    export BRAVE_SEARCH_API_KEY=...
    
  • duckduckgo: no API key required; scrapes DuckDuckGo's HTML endpoint, so it may be less reliable than an API-backed provider.

Example prompt

Search the web for the latest pi-coding-agent extension docs and summarize the top sources.

Package layout

This repository is a pi package. package.json declares:

{
  "keywords": ["pi-package"],
  "pi": {
    "extensions": ["./extensions"]
  }
}

The extension entrypoint is:

extensions/web-search.ts

Pi loads TypeScript extensions directly, so there is no build step.

Publishing to npm

  1. Update package.json metadata (name, version, repository fields if needed).

  2. Preview the npm tarball:

    npm pack --dry-run
    
  3. Publish:

    npm publish
    

After publishing, users can run:

pi install npm:@narumitw/pi-web-search