import { z } from "zod";
import { fetchEventById } from "../services/gamma.js";
const schema = z.object({
id: z.string().describe("The numeric event ID"),
});
export const getEventByIdTool = {
name: "get_event_by_id",
description: "Get event details by id, including associated markets. Source: id from list_events. Example: id=80505.",
parameters: schema,
execute: async (args: z.infer<typeof schema>) => {
try {
const data = await fetchEventById(args.id);
return JSON.stringify(data, null, 2);
} catch (error) {
return JSON.stringify({ error: error instanceof Error ? error.message : String(error) });
}
},
};