thirdfy-app.json reference
The manifest format for a protocol on Thirdfy. Reads over MCP or REST, writes as contract calls, and the rules every write must pass.
thirdfy-app.json describes one protocol. It lists the protocol's actions, and each read action describes what it returns. The format follows JSON Schema 2020-12 ($id https://api.thirdfy.com/schemas/thirdfy-app.v1.json, an identifier, not a download). Start from the example on Submit a protocol gives you a file that passes every check.
App fields
| Field | Meaning |
|---|---|
schemaVersion | 1. |
appId | Your stable id: lowercase letters, digits, _ and -, starting with a letter or digit, up to 64 characters. |
kind | data, data_agent or venue. Use venue for a protocol with writes. |
title, summary | Summary is at most 200 characters. |
category | A data app's shelf, one of the finance data categories market_data, fundamentals, derivatives, onchain, social or news. Optional for a venue: its category comes from its writes (see Categories). Thirdfy refuses an app that is not finance with APP_NOT_FINANCE. |
icon, docsUrl | Optional URLs. |
upstream | { transport, url?, auth }. See below. |
pricing | { model }: none for a free read. |
redistribution | { displayValues, displayRaw, attribution? }: whether agents' users may be shown your values and your raw reply, and the credit line to show. |
manifestVersion | A positive integer. It must grow with every submission. |
contracts | Writes only: { "<chainId>": { "<alias>": "0x…" } }. The only addresses a write may call or approve. |
actions[] | Your actions. |
Reads
A read gets data from your service. Two transports:
mcp_remote: your remote MCP server.upstream.urlis anhttpsURL. Each action names the MCPtoolto call ininvoke.invoke.argumentscan add fixed arguments (literals only).rest: your HTTP API.upstream.urlis anhttpsbase URL. Each action givesinvoke.method(GETorPOST), apathunder that base with whole-segment{param}placeholders, andqueryandbodyfields ({param}or a literal).
Each read action has:
| Field | Meaning |
|---|---|
action | Snake case, for example get_acme_pool_stats. Start with a read verb: get_, list_, fetch_, search_, show_ or check_. |
readOnly | true. |
billingTier, credits | Leave them out. Thirdfy sets what each action costs: a read bills read_offchain, a write bills write. Values you send are replaced, with a warning. |
description | What an agent reads to decide to call it. At most 500 characters. Reviewed by Thirdfy. |
inputSchema | JSON Schema of the params. Only these params reach your service. |
outputSchema | JSON Schema of the typed reading. Required. |
invoke.typed | Maps each typed field to a path in your reply. Without it the whole reply is the reading. |
fixtureParams | Read-only params Thirdfy uses for its checks and its hourly health probe. |
signals[] | Required on every action, and may be empty ([]). Only reads carry entries: named measures with typed fields, a freshness and the roles a strategy may give them (direction, filter, context). |
ttlMs | How long Thirdfy may cache a reading (0 to 3,600,000). |
A read does one fixed thing. Tools that run code or call whatever their input names (a generic execute, a free endpoint_path) cannot be listed.
Thirdfy sends no Thirdfy key to a manifest it has not certified, and keys it holds never appear in the catalog.
Writes
A write is an on-chain call to your contracts, declared as data (upstream.transport: contract_call, auth: none, no url). Thirdfy encodes the call from the action's write block, checks it, and sends it from the agent's wallet.
write field | Meaning |
|---|---|
route | How the owner's wallet policy fences the call: erc4626_self, pinned_call or router_adapter. See below. |
domain | What the write does with money: spot, earn, lending, perps, prediction, launchpad, bridge or internal. It decides your protocol's category (see Categories). |
chains | Chain ids. Each needs an entry in contracts. |
params | What the agent supplies: { <name>: { type, role?, ... } }. Types are fixed size: address, bool, bytes32, uintN, intN. An agent-supplied address needs a role: token, market or spend_token. A uint may take spend_amount (the amount spent from spend_token), min_out (the least the write may return, at most one) or deadline. A param can also declare what a plain value means: see Plain amounts. |
approvals | Optional ERC-20 approvals sent before the call. Exact amounts only. |
spender | Optional: the contract that pulls the tokens when it is not the one the write calls. See Declared spender. |
call | { contract, function, args, pins, value?, maxValueWei? }. |
result | Optional hints for the agent, never part of what is signed: returns and amountOut (the output that is the amount received), events your contracts emit (at most 8) and positionId (the event argument that names a new position). |
opensPosition, exit | A write that opens a position names the write of this app that closes it. |
risk, maxAmountUsd | Risk level, and the most one call may move. Thirdfy may lower maxAmountUsd when it lists you. |
The three routes
| Route | Use it for | Owner signature |
|---|---|---|
erc4626_self | A standard ERC-4626 vault: exactly deposit, withdraw or redeem, with receiver and owner pinned to the agent's wallet. | The owner signs your protocol into the policy once. The rule allows your own vault only. |
pinned_call | Any other function. Your contracts become a group in the owner's wallet policy, with the function and its pinned arguments fixed. | The owner signs your protocol into the policy once. |
router_adapter | Opaque calldata through a Thirdfy router. | Listed, but not executable until the router ships. |
Pins: $self and $owner
args binds every input of the function to $param.<name>, $self (the agent's wallet), $owner (the owner's payout address) or a literal. pins turn into conditions of the wallet policy rule: a pinned path must equal $self (or $owner).
Every recipient-like input must be pinned. Names such as recipient, to, receiver, onBehalfOf, owner and beneficiary count, also inside longer names such as feeRecipient. A pinned input cannot also take agent input. Funds can only come back to the agent's wallet.
Approvals
approvals entries are { token, spender, amount }, where token is $param.<name> or an alias and spender is an alias from contracts. The amount is $param.<name> or a decimal. An approval is for the exact amount of the call and never unlimited: an amount of 2^128 or more is refused.
What a write may not do
The checks refuse a write when:
- a function input is unbound, or an arg names no input;
- a recipient-like address is not pinned;
- an input is an array,
bytesorstring; - the function is a multicall wrapper (
multicall,execute,aggregate,batch), because the wallet policy cannot see inside it; - a payable function has no
maxValueWei, or a non-payable one sends value; - an approval is unlimited;
- an address that is neither zero nor in
contractsappears as a literal; - the name is not
<appId>_<verb>(for exampleacme_deposit) or starts with a read verb; - the billing tier is not a write tier;
- a write that opens a position has no
exit, or theexitis not a write of this app; - a
spotorbridgewrite opens a position; - an approval names a contract that is neither the one the write calls nor its declared
spender; - an approval's spender is a shared-allowance contract (Permit2, 0x AllowanceHolder), declared or not.
The app around it has kind: "venue", upstream: { "transport": "contract_call", "auth": "none" }, pricing: { "model": "none" } and contracts: { "8453": { "vault": "0x…", "usdc": "0x…" } }, where the aliases vault and usdc are the ones the action uses. The submission checks tell you if a field is missing.
Categories
Your writes' domain decides your protocol's category. A venue's category is the domain most of its writes have, and every domain it writes in is listed with it. A data app keeps its declared category.
| Domain | Meaning | Shown as |
|---|---|---|
spot | Swap one token for another, no position | Trading |
earn | Deposit to earn yield, withdraw at will (vaults, staking, supply-only lending) | Yield |
lending | Borrow against collateral, repay, manage a debt position | Lending |
perps | A leveraged position with a side | Perpetuals |
prediction | Buy or sell an outcome | Prediction |
launchpad | Buy or sell on a bonding curve, launch a token | Launchpad |
bridge | Move tokens across chains | Bridge |
A write declared earn that borrows, changes a debt position or closes a borrow is read as lending. When the checks find a write that looks mislabeled (an opening write without opensPosition, a borrow that is not high risk), they warn and Thirdfy's review decides. The live list of categories is categories[] in GET https://api.thirdfy.com/api/v1/agent/actions/catalog.
Plain amounts (intent declarations)
A write param can declare what an owner-level value means. Agents then send "1.5", "max" or "USDC", and Thirdfy works out the raw value from the agent's wallet. Declare what a value means, never how to compute it.
| Field | Meaning | Example |
|---|---|---|
units: { token } | A whole amount of a token: $param.<name>, a contract alias, or native. Converted with the token's own decimals() | { "token": "$param.asset" } |
units: { decimals } | A fixed-point number that is not a token | leverage { "decimals": 2 } (3 becomes 300) |
maxFrom | What "max" means: the wallet's balance of a token (balanceOf), a view plus a margin (call, plusBps), or the protocol's "all" value (sentinel). debtFrom names a debt view: while it is above 0, "max" is refused | repay the current debt plus 10 bps |
fill | A value Thirdfy reads when the agent sends none: a view (call), or a band of another param (bpsOf, bps) | an oracle price |
default: "max" | The param is "max" when left out | a full repay |
values | Words for raw values (2 to 16 lowercase words) | { "long": true, "short": false }, { "yes": 0, "no": 1 } |
options with selectBy: "best_quote" | 2 to 6 raw values. When the agent leaves the param out, Thirdfy quotes each one and takes the largest output | a fee tier ["100", "500", "2500", "10000"] |
role deadline | Unix seconds; now plus 20 minutes when left out |
A view is written name(type name, ...) view returns (...) on a contract alias, with args of $self, $param.<name> or literals, and output naming a numeric output. It may read a contract no write calls; that contract never enters the wallet policy.
What Thirdfy does for a write with at least one declaration:
- Tokens by symbol. A
tokenorspend_tokenparam also takes a symbol. - Minimum output from a quote. When the agent sends neither the
min_outparam norslippageBps, Thirdfy quotes the exact call and sets the minimum 50 bps below it. - Balance check. A spend the wallet can't cover is refused before anything is built (
INTENT_INSUFFICIENT_BALANCE). - What it resolved. The preview and the execute answer list
resolved, one row per param Thirdfy set. A value it cannot resolve is refused with anINTENT_*code, and nothing is sent. - The catalog shows agents the whole-amount schema, and the params Thirdfy fills are not required.
fixtureParams stay in raw base units. Draft with AI proposes these declarations for you, and the submission view says in plain words what the agent sends for each param, for example agent sends 1.5 USDC → 1500000.
Quotes and the minimum output
A write with a min_out param or a declared result.amountOut gets a quote in the preview (MCP previewOrder): Thirdfy simulates the call, from the agent's wallet when it can. Agents may send slippageBps (at most 1000) instead of a minimum, and Thirdfy sets the minimum that far below a fresh quote at execute. A write it cannot quote then is refused; it is never sent without a minimum. The preview also returns a short-lived previewId that execute can check, so the order that runs is the one that was previewed.
Declared spender
By default a write approves only the contract it calls. When another contract pulls the tokens (a vault admin, a router's spender), declare it: spender: { contract, reason, maxAmount }. contract is an alias in contracts on every chain of the write, reason says why it pulls the tokens, and maxAmount (base units) caps every approval to it. The checks prove on chain that the spender really pulls the tokens, and Thirdfy reviews each one per chain before listing.
fixtureParams
Every write needs fixtureParams: example params Thirdfy uses to build the call, simulate it and run the policy proof. Reads use them for the check call and the health probe. Use harmless values and read-only params.
exit
A write that opens a position (a deposit, a swap into a token, a new order) must name, in exit, the write of the same app that closes it. An agent that opens a position through you must always have a way out, and Thirdfy tests it.
After a check fails
The submission page lists each finding with its path in the manifest. Fix the manifest, raise manifestVersion and submit again.