Calculate bracket standings
calculate_bracket_standingsRead-onlyIdempotent
Use this when the user reports results of a tournament made with generate_tournament_bracket (or describes one) and wants the updated bracket, who advances, the standings table or what is next. Takes the same format and participants plus every result so far (winner or scores per match) and returns the advanced bracket, the round robin or Swiss table (points, head-to-head, score difference; Buchholz for Swiss), final places, the next Swiss round's pairings, and the next matches to play. Do not use to predict outcomes; it only records results the user gives.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| paper | No | Paper size for the landscape PDF: letter (default) or a4. Example: a4 | |
| title | No | Tournament name for the bracket, PDF and CSV. Example: "Friday Ping Pong Cup" | |
| courts | No | Courts, tables, boards or fields available at the same time (1-64), used for the timetable. Example: 3 | |
| format | Yes | Tournament format: single_elimination (knockout), double_elimination (out after two losses, losers bracket, grand final), round_robin (everyone plays everyone once; league), swiss (fixed number of rounds, players with equal scores meet, no rematches). Example: single_elimination | |
| results | No | Results already played, in any order for elimination formats and round by round for Swiss. Each needs the players (p1, p2) or a match id, plus a winner or both scores. Example: [{"p1":"Ann","p2":"Finn","score1":21,"score2":12}] | |
| seeding | No | standard (default): list order is the seed ranking, 1 plays the lowest seed, top seeds get the byes and seeds 1 and 2 can only meet in the final. random: a reproducible random draw (see random_seed), then placed like seeds. as_listed: fill the bracket top to bottom in list order, 1st vs 2nd, 3rd vs 4th, with byes spread evenly. Example: random | |
| meetings | No | Round robin only: 1 (default) = every pair meets once; 2 = home and away (double round robin). Example: 2 | |
| start_time | No | Start time of the first matches, 24-hour HH:MM (default 09:00). Example: "18:30" | |
| win_points | No | Round robin / Swiss table points for a win (default 3 for round robin, 1 for Swiss). Example: 2 | |
| draw_points | No | Points for a draw (default 1 for round robin, 0.5 for Swiss). Example: 1 | |
| loss_points | No | Points for a loss (default 0). Example: 0 | |
| random_seed | No | Draw number for random seeding (1-999999). The same participants and number always give the same draw. Example: 4821 | |
| participants | No | Players or teams, 2-128 unique names. With standard seeding the order is the ranking: first = seed 1. Example: ["Ann","Bob","Cy","Dee","Eve","Finn"] | |
| swiss_rounds | No | Swiss only: number of rounds (default log2 of the field, rounded up; maximum depends on the field size). Example: 5 | |
| break_minutes | No | Changeover time between matches on a court, in minutes (0-120, default 0). Example: 5 | |
| match_minutes | No | Length of one match in minutes (5-600). Giving this adds start times and courts to every match. Example: 20 | |
| grand_final_reset | No | Double elimination only (default true): if the losers-bracket champion wins the grand final, a second deciding match is played, so nobody is out after one loss. Example: false | |
| participant_count | No | Use instead of participants when the user gives only a number: makes Team 1 ... Team N (2-128). Example: 12 | |
| third_place_match | No | Single elimination only: add a third-place match between the semifinal losers. Example: true |
Output Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| byes | Yes | ||
| kind | Yes | ||
| notes | Yes | ||
| swiss | Yes | ||
| title | Yes | ||
| counts | Yes | ||
| format | Yes | ||
| matches | Yes | ||
| request | Yes | ||
| results | Yes | ||
| seeding | Yes | ||
| champion | Yes | ||
| complete | Yes | ||
| schedule | Yes | ||
| downloads | Yes | ||
| standings | Yes | ||
| placements | Yes | ||
| random_seed | Yes | ||
| bracket_size | Yes | ||
| format_label | Yes | ||
| next_matches | Yes | ||
| participants | Yes |