import { z } from "zod";
import { fetchSeriesById } from "../services/gamma.js";
const schema = z.object({
id: z.string().describe("The series ID"),
});
export const getSeriesByIdTool = {
name: "get_series_by_id",
description: "Get series by id. Source: id from list_series. Series includes events array. Example: id=10543.",
parameters: schema,
execute: async (args: z.infer<typeof schema>) => {
try {
const data = await fetchSeriesById(args.id);
return JSON.stringify(data, null, 2);
} catch (error) {
return JSON.stringify({ error: error instanceof Error ? error.message : String(error) });
}
},
};