import { z } from "zod";
import { getLiveVolume } from "../services/data-api.js";
const schema = z.object({
id: z.string().describe("Event ID to get live volume for"),
});
export const getLiveVolumeTool = {
name: "get_live_volume",
description: "Get live trading volume for an event. Source: event id from list_events. Example: id=80505.",
parameters: schema,
execute: async (args: z.infer<typeof schema>) => {
try {
const data = await getLiveVolume(args);
return JSON.stringify(data, null, 2);
} catch (error) {
return JSON.stringify({ error: error instanceof Error ? error.message : String(error) });
}
},
};