JSON Schema for Bitcoin Agent Tools
Research question
A tool schema constrains the shape of a Bitcoin balance request.
The network and address type are separate fields. A Testnet-only constant prevents a valid instance from selecting Mainnet. Required fields prevent implicit defaults; additionalProperties rejects injected URL, credential or route fields. A schema is not authorization: the executor must validate every call, including calls produced outside the model. A valid instance is {"net":"test","type":"taproot"}. Missing net, extra keys and unsupported address types must fail. JSON parsers may collapse duplicate keys before validation, so reject ambiguous input at the parsing boundary.
Reference implementation
1{
2 "$schema": "https://json-schema.org/draft/2020-12/schema",
3 "title": "WAB Testnet balance arguments",
4 "type": "object",
5 "properties": {
6 "net": {
7 "type": "string",
8 "const": "test"
9 },
10 "type": {
11 "type": "string",
12 "enum": [
13 "segwit",
14 "taproot"
15 ]
16 }
17 },
18 "required": [
19 "net",
20 "type"
21 ],
22 "additionalProperties": false
23}Applying the example
Use a Draft 2020-12 validator to check candidate arguments offline. For MCP, place the object schema in inputSchema; for another framework, translate it to that framework’s supported schema subset. No HTTP request is made.
Scope and limitations
This is an independent educational design, not a mandatory SDK or a live-tested integration. The engine remains authoritative. No SEND or recovery tools are exposed. Do not put BTC KEY in tool arguments or model context. Verify the deployed API contract before connecting a wallet.
