import { z } from "zod";
import { getTotalTraded } from "../services/data-api.js";
const schema = z.object({
user: z.string().describe("User Ethereum address (0x...)"),
});
export const getTotalTradedTool = {
name: "get_total_traded",
description: "Get total markets a user has traded in (public data). Use user address. Example: user=0xabc....",
parameters: schema,
execute: async (args: z.infer<typeof schema>) => {
try {
const data = await getTotalTraded(args);
return JSON.stringify(data, null, 2);
} catch (error) {
return JSON.stringify({ error: error instanceof Error ? error.message : String(error) });
}
},
};