No description
Find a file
otmatas e1b5ca307a
Some checks failed
CI / test (push) Has been cancelled
Update package metadata
2026-06-04 15:39:15 +02:00
.github/workflows Initial fresh import 2026-06-04 15:28:33 +02:00
assets Initial fresh import 2026-06-04 15:28:33 +02:00
extensions Initial fresh import 2026-06-04 15:28:33 +02:00
tests Initial fresh import 2026-06-04 15:28:33 +02:00
.gitattributes Initial fresh import 2026-06-04 15:28:33 +02:00
.gitignore Initial fresh import 2026-06-04 15:28:33 +02:00
CHANGELOG.md Initial fresh import 2026-06-04 15:28:33 +02:00
LICENSE Initial fresh import 2026-06-04 15:28:33 +02:00
package.json Update package metadata 2026-06-04 15:39:15 +02:00
README.md Initial fresh import 2026-06-04 15:28:33 +02:00
tsconfig.json Initial fresh import 2026-06-04 15:28:33 +02:00

pi-agent-curl-tool

Pi package that adds a curl_fetch tool. It downloads a URL, strips boilerplate (scripts, styles, comments, nav, footer, head metadata), and converts the HTML into compact Markdown so the agent uses fewer tokens.

No configuration. Sensible defaults are baked in:

  • 30s timeout
  • 2 MB max download
  • 12 000 character Markdown cap (override per-call with maxMarkdownChars)
  • Follows up to 5 redirects

Install

Install from npm once published:

pi install npm:pi-agent-curl-tool

Install directly from Git:

pi install git:https://git.otmatas.com/otmatas/PI-Curl.git

Or test without installing permanently:

pi -e git:https://git.otmatas.com/otmatas/PI-Curl.git

Local development install from this folder:

npm install
npm run typecheck
npm test
npm pack --dry-run
pi install ./

Tool

  • curl_fetch
    • url absolute http(s) URL to fetch.
    • maxMarkdownChars optional, default 12000.

The tool returns:

  • HTML pages → Markdown with the page title, description, canonical URL, and the body content. Scripts, styles, <head>, navigation, footers, iframes, comments and SVGs are stripped before conversion.
  • JSON / plaintext / XML → the raw response body.

Output is truncated to maxMarkdownChars to keep the context small. The tool can fetch any absolute http or https URL, including local/internal URLs.

Example prompts

Llegeix https://example.com i resumeix-me la pàgina en tres frases.
Fetch https://api.github.com/repos/anthropics/claude-code and tell me the
star count.