// File generated from our OpenAPI spec by Automated MCP Tools Generator import { EasychampWithAIOptimize } from '../../../easychamp-ai-client'; export const metadata = { resource: 'aioptimize.champs', operation: 'write' as const, tags: ['Champ'], httpMethod: 'post', httpPath: '/aioptimize/champs', operationId: 'CreateChamp', }; export const tool = { name: 'create_champ_aioptimize_champs', description: 'Creates a new competition/tournament. If no name is provided, a name will be generated using the user\'s name and today\'s date. If the specified league doesn\'t exist, it will be automatically created with the name \'{CompetitionName} League\'. Example request: { "name": "MyMarch5" } or simply an empty object {} for auto-generated name.', inputSchema: { type: 'object' as const, properties: { name: { type: 'string' as const, description: 'The name of the championship/competition. If not provided, a name will be auto-generated based on the user\'s name and current date. Example: "MyMarch5", "Summer Tournament 2023"', nullable: true, }, leagueId: { type: 'string' as const, description: 'The ID of the league this championship/competition belongs to. Optional - if not provided, the system will look for a league with the name specified in LeagueName or create a new league.', format: 'uuid', nullable: true, }, leagueName: { type: 'string' as const, description: 'The name of the league this championship/competition belongs to. Optional - if not provided, and LeagueId is also not provided, a new league will be created with the name "{CompetitionName} League". Example: "March5Test", "Premier League"', nullable: true, }, sportKind: { type: 'string' as const, description: 'The sport kind for this competition. Examples: "Soccer", "Basketball", "Tennis". This is used to suggest existing leagues of the same sport.', nullable: true, }, startDate: { type: 'string' as const, description: 'The start date of the championship/competition. If not provided, defaults to the current date. Format: "YYYY-MM-DD" or ISO 8601 format.', format: 'date', nullable: true, }, endDate: { type: 'string' as const, description: 'The end date of the championship/competition. If not provided, defaults to 7 days after the start date. Format: "YYYY-MM-DD" or ISO 8601 format.', format: 'date', nullable: true, }, isPublished: { type: 'boolean' as const, description: 'Indicates if this championship/competition is published and visible on the website. Default is true.', }, description: { type: 'string' as const, description: 'A brief description of the championship/competition. Optional field. Example: "Annual soccer tournament for local teams"', nullable: true, }, imageUrl: { type: 'string' as const, description: 'URL to the championship/competition logo or image. Optional field.', nullable: true, }, teamNames: { type: 'array' as const, items: { type: 'string' as const, }, description: 'List of team names to create and add to this competition. The teams will be created if they don\'t exist. Example: ["Team A", "Team B", "Team C"]', nullable: true, }, teamIds: { type: 'array' as const, items: { type: 'string' as const, format: 'uuid', }, description: 'List of existing team IDs to add to this competition. Use this if you already have team IDs.', nullable: true, }, }, }, }; export const handler = async (client: EasychampWithAIOptimize, args: Record | undefined) => { const body = args as any; // Use the client's resource method instead of standalone function return client.champs.createChamp(body); }; export default { metadata, tool, handler };