pi-search-tool
A pi extension that provides web search and content fetch tools using search-headless
Package details
Install pi-search-tool from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:pi-search-tool- Package
pi-search-tool- Version
0.1.0- Published
- May 30, 2026
- Downloads
- not available
- Author
- jandrikus
- License
- Apache-2.0
- Types
- extension
- Size
- 31.9 KB
- Dependencies
- 0 dependencies · 2 peers
Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
pi-search-tool
A pi extension that provides web search and content fetch tools using search-headless.
Features
- search — Search the internet using Brave Search (default). Returns titles, URLs, and snippets in markdown format.
- fetch — Fetch and extract clean content from any URL. Uses multiple extraction methods (Obscura, HTTP+Readability, Playwright) for best results.
Prerequisites
This extension requires search-headless to be installed:
cd ~/dev/search-headless
./install.sh
This installs the search-web and fetch-content CLI commands globally.
Installation
Add this extension to your pi configuration:
{
"extensions": ["pi-search-tool"]
}
Or install via npm:
npm install pi-search-tool
Usage
Search
Search the web for information:
search(query: "best practices for REST API design", limit: 10)
Returns markdown-formatted results with titles, URLs, and snippets.
Fetch
Fetch full content from a URL:
fetch(url: "https://example.com/article", maxChars: 50000)
Returns clean, readable markdown content extracted from the page.
How It Works
- Search calls
search-web --format markdownfrom search-headless - Fetch calls
fetch-content --format markdownfrom search-headless - Both tools run synchronously and return results directly
- Output is in markdown format for easy reading by LLMs
Tool Guidelines
When to Use Search
- Finding relevant web pages for a topic
- Discovering documentation, tutorials, or examples
- Researching best practices or solutions
When to Use Fetch
- Reading full content of URLs found via search
- Accessing primary sources in depth
- Extracting clean content from complex web pages
Configuration
The extension uses sensible defaults:
- Search limit: 10 results (configurable, max 20)
- Fetch max chars: 50,000 characters (configurable, max 200,000)
- Timeout: 30 seconds (max 2 minutes)
License
Apache-2.0