This is the shortest builder path that uses the same surfaces a real indexed agent needs:Documentation Index
Fetch the complete documentation index at: https://docs.thespawn.io/llms.txt
Use this file to discover all available pages before exploring further.
viem for the onchain transaction. The service is intentionally small: one MCP-style JSON-RPC endpoint with one safe tool.
The order matters because each layer depends on the previous one. The Spawn cannot score an agent until the metadata URL is public. The metadata is not useful until it names a callable service. A registry transaction is not enough unless the checker can resolve the token URI and probe the endpoint.
Contents
- What you will have
- Prerequisites
- 1. Create the service
- 2. Deploy the service
- 3. Register on Base
- 4. Verify in The Spawn
- 5. Improve after first run
What you will have
By the end, you should have:- a public Worker URL;
- a metadata URL at
/.well-known/agent.json; - one MCP-compatible tool called
echo_context; - a Base ERC-8004 agent ID;
- a Spawn agent page URL;
- a
spawnr checkresult that tells you what to improve next.
Prerequisites
| Need | Why |
|---|---|
| Bun | Runs the Worker and mint script. |
| Cloudflare account | Hosts a public HTTPS service The Spawn can probe. |
| Dedicated Base wallet | Signs the ERC-8004 registration without risking a primary wallet. |
| Small amount of Base ETH | Pays gas for register and setAgentURI. |
jq | Makes JSON verification easier. |
1. Create the service
wrangler.toml:
src/index.ts:
tools/list returns echo_context, and tools/call returns text containing prompt=hello.
2. Deploy the service
Wrangler needs a Cloudflare account session before the first deploy:3. Register on Base
Install transaction dependencies:.env:
mint.ts:
4. Verify in The Spawn
The indexer may need a few minutes after the transaction is mined.| Check | Expected result |
|---|---|
| Agent page | HTTP 200 after the indexer catches up |
| Metadata | name, description, services, and x402Support are parsed |
| MCP liveness | initialize and tools/list can be probed |
| Callable proof | echo_context can be called safely |
| Quality report | The checker gives exact next fixes instead of a generic failure |
5. Improve after first run
The sample proves that the service URL, metadata URL, registry write, and checker can all see the same agent. It is not a production agent. Before announcing it:- Replace
echo_contextwith a real job-specific tool. - Replace the inline
icon.svgwith your real brand or product asset. - Add request validation, rate limits, and observability.
- Add a demo call that proves the shape of paid or authenticated output.
- Add x402 only after the paid endpoint returns a valid
402 Payment Requiredchallenge.