# Agent402 Decide: Tool Plan for a Task

> Agent402 Decide: Tool Plan for a Task is a paid API for AI agents from agent402.tools, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-14).

Given a task description, returns a call-ready multi-step tool plan with ranked tools, fallbacks, input parameters, and cost/latency estimates across the x402 catalog.

## Facts

- Endpoint: POST https://agent402.tools/api/decide?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-decide-tool-plan-for-a-task-440b7dc3
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_pRPsFoR2hpaNNubdu0Z1b

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability agent402-decide-tool-plan-for-a-task-440b7dc3 -d '<json body>'
```

Example prompt: Can you plan out all the tool calls I'd need to research the latest EU AI Act obligations for general-purpose models and compile a cited summary — give me a full plan with validated input params and cost estimates, keeping total spend under $0.50?

## When to prefer this

Use this endpoint when an agent needs to dynamically discover and sequence multiple tools to complete an open-ended task, especially when the optimal tool chain is not known in advance. Prefer it over hardcoded tool selection when tasks vary, budgets must be respected, or fallback resilience is needed. The 'full' depth is ideal when you want compiled prompts with pre-validated parameters ready to execute; 'quick' is best for fast single-tool lookup; 'plan' balances detail and speed for multi-step workflows.

## Known failure modes

- Task description exceeds 2000 characters — request rejected
- No tools found matching the constraints — empty plan returned with gaps array populated
- Specified depth value not in enum — validation error
- Budget or latency constraints too tight — partial plan returned with partial:true
- Tool catalog unavailable or stale — reduced confidence scores
- Invalid CAIP-2 chain identifiers in constraints — schema validation error

## How this service works

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, input params that validate against each tool's schema, and cost/latency estimates. Priced by depth: quick (one best tool), plan (steps + fallbacks), full (plan + params + compiled prompt). The fee comes back as a credit toward running the plan with POST /api/decide/execute.

## Output

A JSON object containing an ordered array of tool steps, each with the tool's name, endpoint, payment rail, price, input schema, example parameters, fallback options, a fitness score, and an explanation of why it was chosen. Also includes overall confidence, total estimated cost and latency, a decision ID (reusable for execution), and a neutrality statement describing the ranking formula.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "task": {
   "type": "string",
   "description": "What the agent needs done (max 2000 chars)"
  },
  "depth": {
   "enum": [
    "quick",
    "plan",
    "full"
   ],
   "type": "string",
   "description": "quick | plan (default) | full"
  },
  "constraints": {
   "type": "object",
   "description": "maxBudgetUsd, maxLatencyMs, rails [x402|mpp], chains [CAIP-2 or namespace], excludeSellers [host], requireDeterministic"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "gaps": [],
  "plan": [
   {
    "why": "fit 0.92, score 0.801",
    "step": 1,
    "tool": {
     "id": "a1b2",
     "name": "Web search",
     "rail": "x402",
     "slug": "search",
     "rails": [
      "x402",
      "mpp"
     ],
     "method": "GET",
     "seller": "agent402",
     "endpoint": "https://agent402.tools/api/search",
     "networks": [
      "eip155:8453"
     ],
     "priceUsd": 0.02,
     "firstParty": true,
     "inputSchema": {
      "type": "object",
      "required": [
       "q"
      ],
      "properties": {
       "q": {
        "type": "string"
       }
      }
     },
     "exampleParams": {
      "q": "EU AI Act general-purpose AI model obligations 2026"
     },
     "exampleParamsSource": "task",
     "executeViaAgent402Usd": 0.02
    },
    "score": 0.801,
    "purpose": "search recent sources on the EU AI Act GPAI obligations",
    "dependsOn": [],
    "fallbacks": []
   }
  ],
  "task": "Research the latest EU AI Act obligations for general-purpose models, with citations",
  "depth": "plan",
  "cached": false,
  "partial": false,
  "ranking": {
   "weights": {
    "fit": 0.45,
    "price": 0.15,
    "schema": 0.1,
    "freshness": 0.1,
    "reliability": 0.2
   },
   "firstPartyWeight": 0
  },
  "priceUsd": 0.02,
  "confidence": 0.92,
  "decisionId": "dec_2b1c9e0f4a7d4c3e9b8a1f00",
  "neutrality": "Every candidate is scored by one formula with the same weights: fit to the step, observed reliability, price, schema quality and a freshness pass mark. It has no term for who sells the tool, and every tool carries firstParty. Fit is judged from the same bounded description for every tool; reliability counts one observation per payer per day. Outside tools are eligible when a live 402 was seen within the configured window and their input schema is known.",
  "estimatedCostUsd": 0.02,
  "estimatedLatencyMs": 1500,
  "estimatedCostViaAgent402Usd": 0.02
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-decide-tool-plan-for-a-task-440b7dc3/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
