Skip to content

Decide: tool plan for a task

quoted per request from $0.003USDC via x402POST /api/decide

Describe a job and get a call-ready plan: which tools, across this catalog and outside x402 sellers with a recently verified 402, solve it end to end, in what order, with fallbacks and input params that validate against each tool's schema. Send POST /api/decide with the required field task and pay quoted per request from $0.003 over x402 or MPP (there is no free tier). It returns a JSON object with decisionId, task, depth, plan, estimatedCostUsd and 6 more.

Priced by depth: quick $0.003 (one best tool), plan $0.01 (the default: steps, fallbacks, params from your task, cost and latency estimates), full $0.03 (the plan plus a compiled prompt). The fee comes back as a credit toward running the plan with POST /api/decide/execute. Free first: GET /api/find?q=<task> answers a multi-step task with a keyword plan sketch. The ranking formula has no first-party term; every tool carries firstParty. Uncovered needs are listed in gaps.

Category: Routing & delegationTags: agents routing planning discovery x402

Try in playground →

Parameters

NameTypeRequiredDescription
taskstringyesWhat the agent needs done (max 2000 chars)
depthstring (one of: quick, plan, full)noquick | plan (default) | full
constraintsobjectnomaxBudgetUsd, maxLatencyMs, rails [x402|mpp], chains [CAIP-2 or namespace], excludeSellers [host], requireDeterministic

Example request

curl -i -X POST https://agent402.tools/api/decide \
  -H "Content-Type: application/json" \
  -d '{"task":"Resolve the ENS name vitalik.eth and read its wallet balance on Base","depth":"plan"}'

Without payment this returns HTTP 402 Payment Required with the exact price for decide; any x402 v2 or MPP client pays it and retries.

Example response

{
  "decisionId": "dec_…",
  "task": "Resolve the ENS name vitalik.eth and read its wallet balance on Base",
  "depth": "plan",
  "plan": [
    {
      "step": 1,
      "purpose": "resolve the ENS name to an address",
      "tool": {
        "slug": "ens-resolve",
        "firstParty": true,
        "endpoint": "https://agent402.tools/api/ens-resolve",
        "method": "GET",
        "priceUsd": 0.001,
        "exampleParams": {
          "name": "vitalik.eth"
        }
      },
      "fallbacks": [],
      "dependsOn": []
    },
    {
      "step": 2,
      "purpose": "read that address's balance on Base",
      "tool": {
        "slug": "wallet-balance",
        "firstParty": true,
        "endpoint": "https://agent402.tools/api/wallet-balance",
        "method": "POST",
        "priceUsd": 0.002,
        "exampleParams": {
          "address": "{{step 1}}",
          "network": "base"
        }
      },
      "fallbacks": [],
      "dependsOn": [
        1
      ]
    }
  ],
  "estimatedCostUsd": 0.003,
  "estimatedLatencyMs": 3000,
  "confidence": 0.9,
  "gaps": [],
  "priceUsd": 0.01,
  "executionCredit": {
    "amountUsd": 0.01,
    "token": "dc_…",
    "redeemWith": "POST /api/decide/execute { decisionId, creditToken }"
  },
  "feedbackToken": "fb_…"
}
FieldTypeAlways presentIn the example
decisionIdstringyesdec_…
taskstringyesResolve the ENS name vitalik.eth and read its wallet balance on Base
depthstringyesplan
planarray of objectsyes2 items in the example
estimatedCostUsdnumberyes0.003
estimatedLatencyMsnumberyes3000
confidencenumberyes0.9
gapsarrayyes0 items in the example
priceUsdnumberyes0.01
executionCreditobjectyes3 fields: amountUsd, token, redeemWith
feedbackTokenstringyesfb_…

From an MCP client

catalog.call {
  "slug": "decide",
  "params": {
    "task": "Resolve the ENS name vitalik.eth and read its wallet balance on Base",
    "depth": "plan"
  }
}

The hosted connector at https://agent402.tools/mcp needs a payment for decide; the stdio package pays it from a wallet or from an AGENT402_CREDITS_KEY issued earlier. Local install: npx -y agent402-mcp@0.13.32.

Errors and behavior

Paid call (JavaScript agent)

import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client();
client.setSpendControls?.({ maxAmountPerPayment: "$0.03" }); // refuse any quote above this tool's price
registerExactEvmScheme(client, { signer: privateKeyToAccount(KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);

const res = await payFetch("https://agent402.tools/api/decide", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "task": "Resolve the ENS name vitalik.eth and read its wallet balance on Base",
    "depth": "plan"
  }),
});

Related tools

Decide: execute a plan

from $0.001POST /api/decide/execute

Run a decision's plan (decisionId from POST /api/decide), or a free plan sketch (steps), through Agent402: first-party.

Attest a settled call on Base

$0.05POST /api/attest

Write an on-chain attestation (Ethereum Attestation Service on Base) that binds a call you paid for to the bytes you.

Route and execute

$0.01POST /api/route/execute

Describe a task (or name a slug) and the Smart Order Router resolves the best-matching tool and RUNS it in the same call.

Route and execute (max tier)

$0.55POST /api/route/execute-max

Describe a task (or name a slug) and the Smart Order Router resolves the best-matching tool and RUNS it in the same call.

Route and execute (plus tier)

$0.05POST /api/route/execute-plus

Describe a task (or name a slug) and the Smart Order Router resolves the best-matching tool and RUNS it in the same call.

Route and execute (pro tier)

$3.30POST /api/route/execute-pro

Describe a task (or name a slug) and the Smart Order Router resolves the best-matching tool and RUNS it in the same call.