Skip to main content
Each .ts file in app/tools/ is auto-discovered and registered as a tool on both A2A and MCP endpoints.
import { tool } from "ai";
import { z } from "zod";
import type { Accepts } from "aixyz/accepts";

export const accepts: Accepts = {
  scheme: "exact",
  price: "$0.0001",
};

export default tool({
  description: "Get current weather conditions for a city.",
  inputSchema: z.object({
    location: z.string().describe("City name"),
  }),
  execute: async ({ location }) => {
    // your implementation
  },
});

Exports

ExportTypeRequiredDescription
defaulttool()YesThe tool instance
acceptsAcceptsNoPayment config — gates the tool on MCP /mcp

Conventions

  • Auto-discovered — All .ts files in app/tools/ are registered automatically
  • Ignored files — Files starting with _ (e.g., _helpers.ts) are skipped
  • Naming — The tool is registered with the filename as its name (e.g., weather.tsweather)