Google Agent Development Kit

agent402-google-adk · npm · MIT

ADK FunctionTool instances for Gemini agents built on the Agent Development Kit. Both peers are optional: without @google/adk and zod, agent402ToolSpecs() gives the same four tools with no dependencies.

Install

npm install agent402-google-adk @google/adk zod

Example

import { agent402Tools } from "agent402-google-adk";
import { LlmAgent } from "@google/adk";

const tools = await agent402Tools();   // free tier: proof-of-work, no wallet

const agent = new LlmAgent({
  name: "x402-agent",
  model: "gemini-2.0-flash",
  tools,
  instruction: "Use agent402_find to discover the right tool, then agent402_call to invoke it.",
});

What it exposes

  • agent402_find: a plain-language task in, the best-matching tools out (slug, route, price, input schema, a ready example).
  • agent402_route: ranks tools across every indexed x402 seller; include: "external" leaves this server out.
  • agent402_call: calls a tool by slug and pays for it.
  • agent402_about: the service manifest (payment options, capability map, MCP connector).
  • agent402ToolSpecs() returns the same four as framework-agnostic specs (name, description, JSON Schema, execute) with no framework dependency.

How payment works

  • Pure-CPU tools: agent402_call fetches a proof-of-work challenge and solves it in-process, so no wallet is needed.
  • Wallet-only tools: pass fetch, a payment-wrapped fetch. @x402/fetch pays in USDC over x402 on whichever chain your wallet is funded for; a stock mppx fetch pays over MPP.
  • Unpaid lookups (find, route, about) use fetchImpl and never spend anything.
const tools = await agent402Tools({ fetch: payFetch }); // an x402- or MPP-wrapped fetch

A call that fails is not charged: settlement runs after the tool and only on a successful response. Background: What x402 is · MPP (Machine Payments Protocol).

Tools to try first

Web search$0.02
search
Web answer$0.08
answer
Hash$0.001
hash
Crypto market pulse$0.004
crypto-market-pulse
Route and execute$0.01
route-execute

Every tool, price and input schema: the catalog.

Links

agent402-google-adk on npm · source on GitHub · configuration reference
Guides: Make your AI agent pay for what it needs: x402 in 5 minutes · Why Agent402 settles on twelve chains instead of just Base
All integrations