@siddr/pi-fetch-url

Readable content fetch tool extension for pi

Package details

extension

Install @siddr/pi-fetch-url from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@siddr/pi-fetch-url
Package
@siddr/pi-fetch-url
Version
0.1.5
Published
Apr 24, 2026
Downloads
214/mo · 152/wk
Author
siddr
License
MIT
Types
extension
Size
35.4 KB
Dependencies
3 dependencies · 3 peers
Pi manifest JSON
{
  "extensions": [
    "./index.ts"
  ]
}

Security note

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

README

Fetch URL Extension

Adds a fetch_url tool that fetches a URL and returns the main readable content. By default, it extracts the primary content and converts it to Markdown. You can request raw HTML or extracted HTML if needed. Metadata (title, author/byline, site name, published time when available) is included in the output header.

Install

pi install npm:@siddr/pi-fetch-url

Tool

fetch_url

Parameters:

  • url (string, required) — URL to fetch.
  • raw (boolean, optional) — return raw response body (no extraction).
  • format ("markdown" | "html", optional) — format for extracted content (default: markdown).

Behavior:

  • If raw=true, returns raw response body.
  • If the response is HTML and raw is false, uses Mozilla Readability + fallback heuristics to extract the main content.
  • If the response is not HTML, returns raw text/JSON as-is.
  • Tool output stays collapsed in the UI by default; use Ctrl+O to expand and inspect the fetched text.
  • Context uses pi-style truncation heuristics: output is truncated to 2000 lines or 50KB, and full output is saved to a temp file when truncated.

Example prompts

Fetch https://example.com/article and summarize it.
Fetch https://example.com/article with format="html".
Fetch https://example.com/article with raw=true.