import { z } from "zod";
import { fetchTeams } from "../services/gamma.js";
const schema = z.object({
limit: z.number().optional().default(20).describe("Number of teams to return (default: 20)"),
offset: z.number().optional().default(0).describe("Pagination offset (default: 0)"),
});
export const listTeamsTool = {
name: "list_teams",
description: "List sports teams with pagination. Use to map team names/abbreviations in sports markets. Example: limit=20, offset=0.",
parameters: schema,
execute: async (args: z.infer<typeof schema>) => {
try {
const data = await fetchTeams(args);
return JSON.stringify(data, null, 2);
} catch (error) {
return JSON.stringify({ error: error instanceof Error ? error.message : String(error) });
}
},
};