Use Case · research-agent

How to build an autonomous research agent.

A research agent isn’t a chatbot — it’s a loop. It searches, reads what it finds, narrows the question, searches again, and at the end produces something cited. The model isn’t the limiting factor anymore. The limiting factor is whether your search and fetch tools return clean, schema-shaped text the model can actually reason about.

Search is easy. Fetch is the bottleneck.

Most research loops fall apart the moment the model wants to read a page. Raw HTML is noisy; PDFs need an extractor; arXiv has its own metadata schema; GitHub READMEs are buried under repo trees; rate limits punish naive crawlers. Teams end up writing five custom fetchers and a per-site sanitizer, then babysit them as the web changes underneath.

Worse, the model can’t reason about whether its tools succeeded or failed unless those tools return MCP-compliant JSON with consistent error shapes. Half the “the agent gave up early” failures trace back to a fetcher that returned a 200 with garbage.

wmcp.sh is a tool gateway for exactly this. Point /api/v1/tools?url=... at an arXiv listing, a GitHub repo, a blog post, or a docs site, and get back schema-valid MCP tools your agent can call in a loop. wmcp.sh is not affiliated with arXiv, GitHub, or any cited corpus.

Search → read → reflect → repeat.

1. Question intake. The user supplies a research question and a hard turn budget (typically 8–20). The agent also receives a citation requirement — every claim in the final synthesis must point to a fetched URL.

2. Tool gateway (wmcp.sh). The agent boots with three tool clusters: an arXiv search adapter, a /integration/github adapter for repo and issue search, and a generic fetcher via https://wmcp.sh/api/v1/tools?url=... for any URL.

3. Reasoning loop. Each turn, the model picks search or fetch, reads the result, and decides whether to refine the query, follow a citation, or write a synthesis. A scratchpad tool persists notes across turns.

4. Synthesis + verify. When the agent is ready it emits a final answer with inline citations. A second cheap-model pass verifies that each citation supports the claim — failures bounce back into the loop.

What wmcp.sh provides.

CapabilitySourceHow wmcp.sh wires it
Academic paper searcharXiv✅ Resolve arXiv listing URLs via /api/v1/tools; structured JSON-LD on each abstract page
Repo + issue + code searchGitHub✅ Native adapter at /integration/github
Read a GitHub READMEraw.githubusercontent.com✅ Generic URL extraction returns clean markdown
Read an arbitrary webpageAny URL/api/v1/tools?url=<any-url>
Cite-and-verify a claimSecond model pass✅ Bundled into /managed verifier loop
Scratchpad / notesNotion or Sheets✅ Wire /integration/notion as a write target

An iterative search-then-read loop.

Python sketch. The model decides each turn whether to search or read; the loop ends when it emits a final answer or the turn budget is hit.

import httpx
from anthropic import Anthropic

client = Anthropic()
WMCP = "https://wmcp.sh"

def tools_for(url):
    return httpx.get(f"{WMCP}/api/v1/tools", params={"url": url}).json()["tools"]

tools = (
    tools_for("https://arxiv.org/list/cs.AI/recent")
    + tools_for("https://github.com")              # GitHub adapter
    + tools_for("about:fetch")                     # generic page fetcher
)

messages = [{"role": "user", "content": "Survey 2026 papers on speculative decoding. Cite every claim."}]

for turn in range(20):
    resp = client.messages.create(model="claude-sonnet-4-5", max_tokens=4096,
                                  tools=tools, messages=messages)
    messages.append({"role": "assistant", "content": resp.content})
    if resp.stop_reason != "tool_use": break
    # resolve each tool_use block via wmcp.sh and append tool_result
    # (omitted for brevity — standard Anthropic tool_use protocol)

print(messages[-1])  # final synthesis with inline citations

DIY scrapers vs MCP gateway.

DIY scraper stack:

  • Per-site sanitizers that drift weekly
  • Inconsistent error shapes confuse the model
  • PDF, HTML, and JSON each need a different path
  • Rate-limit handling rolled by hand

wmcp.sh tool gateway:

  • One /api/v1/tools call returns clean MCP tools
  • Edge cached, sub-50ms cold tool listing
  • Uniform error envelopes the model can reason about
  • Add a new source by passing a new URL

Common questions.

What is an autonomous research agent?
A loop — search, read, refine, repeat — that ends with a cited synthesis. Distinct from one-shot RAG by virtue of iteration.
What tools should it have?
A search index, a fetcher, a code-search surface, and a notes scratchpad. wmcp.sh provides the first three; /integration/notion covers the fourth.
How does this compare to Perplexity or ChatGPT deep research?
Hosted products run on a vendor model with vendor tools. A custom agent runs on the model you pick and the corpus you control.
How do you stop runaway loops?
Hard turn budget, hard token budget, mandatory citations, and a verifier pass.
Can the agent read PDFs and READMEs?
Yes. The generic /api/v1/tools?url=... path resolves both into clean text.
Need this built for you?

Hosted research loop with verifier + citations.

Custom corpus adapter + hosted MCP at mcp.yourbrand.com + verified badge. Starter $499 one-time · Managed Retainer $999/mo · Enterprise $4,999+/mo.

See /managed → Submit (free)