Guide

Agents

Two tools on MCP and AI SDK and Pi and OMP. One text for every host. A bounded page per source that says what cut it so the agent narrows the call.

Every host gets the same two tools, urls_providers and urls_discover, and the same text. One answer across MCP, AI SDK, Pi and OMP beats four dialects of it.

MCP

jsonmcp.json
{
  "mcpServers": {
    "urls": {
      "command": "npx",
      "args": ["-y", "@agntn/urls", "mcp"]
    }
  }
}

Want VirusTotal and URLScan at full strength? Put VIRUSTOTAL_API_KEY and URLSCAN_API_KEY in the server's environment. Building your own server? Use createMcpServer from @agntn/urls/mcp. It returns an unconnected server, so the connection is yours to make.

AI SDK

ts
import { urlsAiTools } from "@agntn/urls/ai";
import { generateText } from "ai";

const { text } = await generateText({
  model,
  tools: urlsAiTools,
  prompt: "Which JavaScript files has example.com shipped over the years?",
});

AI SDK 7. Need individual tools instead? discoverTool and providersTool are exported separately. Each call passes its abortSignal down to the sources.

Pi and OMP

shell
pi install npm:@agntn/urls
omp plugin install @agntn/urls

Pi 1.x and OMP pass the host's cancel signal to the tools. Cancel means cancel, not keep asking sources politely.

Why a page and not everything?

A model's context window is a poor place to dump every URL. So a page holds at most 100 URLs per source. Set limit to change that. The library and urls discover stay unbounded.

The first line names the source, the count and the domain. It also says what cut the page. If the limit cut it, narrow the call or raise the limit. If the source stopped on its own, neither a higher limit nor filters help. Filters can't find URLs the source didn't return. Another source might.

What an answer looks like

Here's a real answer, compact enough to leave the model some room to think.

text
[wayback] 2 URLs for "example.com" (limit 2 reached; raise limit or narrow with match, ext, urlScope)
  http://example.com:80/  2002-01-20..2007-07-01
  http://www.example.com:80/  2002-03-28..2007-07-27

After the first line, each line is a URL. One the source dated ends with its first and last capture day.

With provider: "all", each source gets a block. A failed source gets one error line instead. Set reference: true and a via line names the query URL. It sits above the URLs that query returned.

The recorded comparisons on the landing come out at under a third of the same pages as indented JSON. Guess which one a context window prefers. Repeated query URLs cost tokens too, so reference is off by default.

For your code

The AI SDK output carries the page object next to its text. Your code doesn't have to read like a model.

FieldMeaning
providerthe source that answered
countURLs on this page
limitthe bound that applied, the caller's or 100
hasMorethe source had more than fits, or stopped on its own with more advertised
truncatedthe source stopped on its own, its page safeguard or a cursor it won't follow
urlsthe records, each with url, source, input and the dates when the source gave any

With provider: "all" it's { comparison }. Each source is a { provider, result } or a { provider, error }. MCP clients read the text only.

Try it without an agent

The explorer runs urls_discover through the docs worker and shows the exact text a model gets.