Prepare a change
beleeg_prepare_changePREPARE ONLY — nothing changes yet. Pick the change (action) and give its params. Beleeg checks the person may do it, previews exactly what would happen, and returns a plain summary plus a prepare_id that works for 10 minutes. Show the summary to the person and call beleeg_confirm_change with the prepare_id only after they agree. Some changes (a league-wide email, a money record) also need the person to press Approve in Beleeg: the reply says so and gives the link. Needs a token that allows changes. League ids come from beleeg_whoami; match ids from beleeg_look_up what "schedule". Every time a change takes (newTime, matchTime, time, sendAt) is the league's local time, never UTC; leave newTime out to keep the same time — the summary names the zone. If params are wrong, the reply lists exactly what the action takes.
action (params; ? = optional):
create_league: Create a league. Create a new league (and, when no organizationId is given, a new organization named after it) with a first season whose registration opens right away. params {name: text, sport: text, organizationId?: id, organizationName?: text, timezone?: text, city?: text, registrationClosesOn?: text, teams?: [text], inviteEmails?: [email]}
create_tournament: Create a tournament. params {name: text, leagueId?: id, organizationId?: id, format?: single_elim|single_elim_consolation|three_match_guarantee|double_elim|round_robin|pool_to_bracket, entrants?: [text], registrationUnit?: solo|pair, bestOf?: number, description?: text, startsOn?: text, endsOn?: text, priceCents?: number, events?: [{name: text, fieldCap?: number, priceCents?: number}]}
add_players: Add people to a league. Invite people to a league by email, up to 200 at a time. params {leagueId: id, players: [text | {email: email, name?: text, role?: player|captain|co_captain, teamId?: id}], role?: player|captain|co_captain, teamId?: id}
create_teams: Create teams. Create up to 64 teams in a league's current season, optionally placing each in a division (by division name or id). params {leagueId: id, teams: [text | {name: text, division?: text, divisionId?: id}], division?: text, divisionId?: id}
generate_schedule: Build the season schedule. Build a round-robin schedule for the league's current season: one match day per week starting on startDate, for
weeksweeks, at matchTime. params {leagueId: id, startDate: text, weeks: number, matchTime?: text, timezone?: text, skipDates?: [text]}reschedule_match: Move a match. Move one match (matchId), several (matchIds, up to 200), or every unplayed match in a league on a given day (leagueId + fromDate) to newDate, at newTime in the league's local time (leave it out to keep the same time). params {matchId?: id, matchIds?: [id], leagueId?: id, fromDate?: text, newDate: text, newTime?: text, venue?: text}
report_score: Record a score. Record the result of a match: a tournament result, or for a league match only the captain's UNOFFICIAL report (a league admin records the final score with enter_final_score). params {matchId: id, homeScore?: number, awayScore?: number, sideA?: [number], sideB?: [number], note?: text, reporter?: text}
send_announcement: Email the league. Email everyone in a league, or just the players or captains, optionally narrowed to one division or specific teams. params {leagueId: id, subject: text, body: text, audience?: all|players|captains, divisionId?: id, teamIds?: [id], sendAt?: text}
register_player: Register for a league. Register the CALLER as a player in a league whose registration is open. params {leagueId: id}
mark_paid: Mark a player as paid. Record that a league member paid their registration outside Beleeg (cash, check, Venmo) — it charges nobody. params {leagueId: id, userId?: id, email?: email, name?: text}
set_availability: Say who can play. Record whether someone can play a league match: "in", "out", or "maybe". params {leagueId: id, answer: in|out|maybe, matchId?: id, player?: text}
answer_match_checklist: Fill in the match checklist. Answer one thing on a match's checklist — the list the league keeps for every match ("Shot clock operator", "Bringing snacks", "Nets put away"). params {leagueId: id, item: text, answer?: text, clear?: true|false, matchId?: id, side?: text, player?: text}
update_venue_details: Fill in venue details. Save where a league plays and what players should know before they go: the street address, parking, how to find the courts or field, a phone number and a website. params {leagueId: id, venue: text, addressLine1?: text, addressLine2?: text, city?: text, region?: text, postalCode?: text, parkingNotes?: text, directionsNotes?: text, phone?: text, website?: text}
propose_match_time: Ask to move a match. A captain asks the other team to move a league match to a new date and time (and optionally a new place). params {leagueId: id, newDate: text, newTime?: text, matchId?: id, venue?: text, note?: text}
respond_match_proposal: Answer a request to move a match. Answer an open request to move a league match: "accept" or "decline" (the other team's captain, or a league admin when it waits for approval), or "withdraw" (the captain whose team asked). params {leagueId: id, answer: accept|decline|withdraw, matchId?: id, note?: text}
submit_team_score: Put in our team's score. A team captain or co-captain puts in their own team's score for a league match (or one of the two players in a one-on-one match). params {leagueId: id, ourScore?: number, theirScore?: number, homeScore?: number, awayScore?: number, matchId?: id}
respond_to_score: Answer the other team's score. A captain or co-captain answers the score the OTHER team put in: decision "confirm" (it's right — it then counts in the standings) or "dispute" (it's wrong — it goes to the league admins, who decide the final score; a reason is required, e.g. params {leagueId: id, decision: confirm|dispute, reason?: text, category?: score|lineup, matchId?: id}
message_team: Post in the team chat. Post a message in a team's chat, under the caller's own name — everyone on the team sees it. params {leagueId: id, message: text, team?: text}
remind_no_response: Remind the ones who haven't answered. A captain sends every player on their team who has not said whether they can play a match a notice in Beleeg asking them to answer. params {leagueId: id, matchId?: id}
set_lineup: Send our lineup. A team captain or co-captain sends the team's lineup for a match: who plays on which line (lines), or just who plays (players) in a sport without lines. params {leagueId: id, lines?: [{line: number, players: [text]}], players?: [text], matchId?: id}
postpone_matches: Postpone a day of matches. Rain-out: every unplayed match in the league on one day (date, default today in the league's time zone) moves to another day — a week later by default (shiftDays), or to toDate — keeping each start time. params {leagueId: id, date?: text, shiftDays?: number, toDate?: text, noNewDate?: true|false}
cancel_match: Call off matches. Call off (cancel) one unplayed match (matchId) or every unplayed match on a day (date). params {leagueId: id, matchId?: id, date?: text}
record_forfeit: Record a forfeit. Record that a team forfeited a league match: the other team gets the win and its points and the standings update. params {leagueId: id, team: text, matchId?: id, date?: text, note?: text}
resolve_score_dispute: Settle a score disagreement. A league admin settles a disputed score: give the final score (finalHome, finalAway — lines won, or goals/runs) or scoreStands:true to keep the score that was put in. params {leagueId: id, finalHome?: number, finalAway?: number, scoreStands?: true|false, note?: text, matchId?: id}
review_lineup: Approve a lineup. A league admin approves (or sends back) a lineup a captain sent. params {leagueId: id, decision: approve|reject, team?: text, matchId?: id}
nudge_score_answer: Chase a score confirmation. A league admin reminds the other team's captains to confirm a score one team put in (a notice in Beleeg). params {leagueId: id, team?: text, matchId?: id}
assign_captain: Make someone captain. Make a league member the captain of a team (replacing the current captain), or with role co_captain add them as a co-captain. params {leagueId: id, team: text, person: text, role?: captain|co_captain}
move_player: Move a player to another team. Put a league member on a team, taking them off any other team in this league. params {leagueId: id, person: text, team: text}
assign_referee: Assign a referee. Make a league referee the referee for one unplayed match. params {leagueId: id, referee: text, matchId?: id, date?: text, team?: text}
add_blackout_date: Block off days with no matches. Mark a day, or a run of days up to a month (date through endDate), as a day the league does not play (a holiday). params {leagueId: id, date: text, endDate?: text, reason?: text}
set_league_setting: Change a match-day setting. Change one of these league settings: arriveBefore (minutes early players should arrive, 0-180; "off" = 0), whatToWear (a short note shown on every match; "off" clears it), captainScheduling (who can move a match: "admins", "admin_approves", or… params {leagueId: id, setting: arriveBefore|whatToWear|captainScheduling|weatherAdvisories, value: text}
remind_unpaid: Remind whoever hasn't paid. Send every league member who has not paid the league's registration fee a friendly reminder (a notice in Beleeg pointing to the league page). params {leagueId: id}
direct_message: Send someone a message. Send one league member a private message in Beleeg, from the caller ("ask Tom if the courts are playable"). params {leagueId: id, person: text, message: text}
notification_prefs: Change my notifications. Change the caller's own notification settings: matchReminders, matchReminderHoursBefore (1 or 24), messageAlerts, leagueAnnouncements (emails from organizers), weeklyDigest, textMessages (can only be turned OFF here — turning texts on is done in the app),… params {matchReminders?: true|false, matchReminderHoursBefore?: number, messageAlerts?: true|false, leagueAnnouncements?: true|false, weeklyDigest?: true|false, textMessages?: true|false, quietHours?: true|false, quietStart?: text, quietEnd?: text}
team_dues: Team dues (the team kitty a captain collects — beer money, a shared fee). params {leagueId: id, task: record|remind, person?: text, paid?: true|false, amount?: text, note?: text, team?: text}
join_team: Join a team. The CALLER joins a league as a player on a named team ("put me on the Hawks"), when the league lets players pick their team, registration is open and public, the team has room, and the league has no fee (a league with a fee registers on its page, with… params {leagueId: id, team: text}
cancel_scheduled_email: Call off a scheduled email. Call off a league email that was set to go out later, before it goes. params {leagueId: id, subject?: text}
rollover_season: Start the next season. Start the league's next season from the current one: the current season is marked finished (its results and standings are kept as they are), a new season opens with sign-ups running until it starts, and the teams carry over with their names, colors, captains… params {leagueId: id, name: text, startsOn?: text, endsOn?: text, keepTeams?: true|false, keepPlayers?: true|false}
create_event: Add an event. Add a free social event (a party, a clinic, an awards night) to the league — or to the whole organization with wholeOrganization:true. params {leagueId: id, title: text, date: text, time: text, endTime?: text, location?: text, description?: text, capacity?: number, wholeOrganization?: true|false}
rsvp_event: Say if I am coming to an event. The CALLER says whether they are coming to an upcoming event: going, maybe, or cant (not going). params {leagueId: id, event?: text, answer: going|maybe|cant}
review_sponsor: Approve or decline a sponsor. Approve a sponsor application (their logo starts showing on the league's pages) or decline it. params {leagueId: id, sponsor: text, decision: approve|decline}
offer_waitlist_spot: Offer the next person on the waiting list a spot. When the league has an open spot, offer it to the next person on its waiting list; they get a notice in Beleeg to sign up soon (someone with no Beleeg account is not told automatically — the summary says so). params {leagueId: id}
follow_team: Follow a team. The CALLER follows a team in this league ("follow the Hawks"), so its games and results show with the other teams they follow. params {leagueId: id, team: text}
enter_final_score: Enter a final score. A league admin records the FINAL, official score of a league match: it counts in the standings straight away and nobody is asked to confirm it (a captain's own score goes through submit_team_score; report_score only files an unofficial report). params {matchId: id, homeScore: number, awayScore: number, replace?: true|false, note?: text, leagueId?: id}
ladder_challenge: Send a ladder challenge. Challenge a team or player above you on the league's ladder for their spot (a player for themself; for a team, its captain — or any player where the league lets members play the ladder). params {leagueId: id, opponent: text, date?: text, time?: text, venue?: text}
ladder_respond: Answer a ladder challenge waiting on the person (their own spot, or their team's as its captain): "accept" or "decline". params {leagueId: id, answer: accept|decline, challenger?: text, date?: text, time?: text, venue?: text}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | The change to prepare. Every value is listed, with its params, in the tool description. | |
| params | No | The params for that action, exactly as listed for it in the description (camelCase keys, e.g. leagueId). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | ||
| changes | Yes | Structured preview of the same (counts, names, before/after). | |
| summary | Yes | Plain-language description of exactly what confirming will do. Show it to the person. | |
| expires_at | Yes | ISO 8601 timestamp; the prepare_id stops working after this (10 minutes). | |
| prepare_id | Yes | Pass to beleeg_confirm_change once the person agrees. | |
| approve_url | No | Where the person approves. Give it to them exactly as written; never build one yourself. | |
| approval_required | No | True for changes that cannot be taken back (a league-wide email, a money record, a card payment). Beleeg will refuse the confirm until the person approves it in Beleeg itself. Your own confirmation is not enough and cannot substitute. |