# TeamSync — full reference > Create fair, random teams in seconds Split any list of names into fair, random teams in seconds. Free, private and works offline — everything runs in your browser. Version: 1.0.4 ## Usage modes - Browser: https://simeontsvetanov.github.io/teamsync-random-team-generator/ (installable PWA, works offline after first visit) - MCP (local): npx -y @simeonts/teamsync-random-team-generator-mcp - Embed: iframe + postMessage (below) ## URL parameters - `teams` = 2–10 (default 2): Number of teams to make (names are never put in the link) - `lang` = en | bg (default en): Interface language for this visit (without it: your saved choice, else English); it is not saved - `embed` = 1: compact embed mode (also automatic inside an iframe); see Embed below - Example: https://simeontsvetanov.github.io/teamsync-random-team-generator/?teams=2&lang=en Internal (set by the app or the operating system; not for links you write): - `share-target` = 1 (+ title, text, url): Android “Share → TeamSync”: the shared text becomes the names list; the parameters are removed from the address bar right away App shortcuts (long-press the installed app icon): - Make 2 teams: https://simeontsvetanov.github.io/teamsync-random-team-generator/?teams=2 - Make 3 teams: https://simeontsvetanov.github.io/teamsync-random-team-generator/?teams=3 ## Embed (iframe + postMessage) - Markup: - Origin rules: the app only works with the page that embeds it — its origin is taken from document.referrer. Requests are accepted only when event.origin equals that origin and event.source is window.parent; anything else (including messages that fail validation or are too large) is ignored without a reply. The app posts events only to that exact origin, never "*". With no referrer (e.g. referrerpolicy="no-referrer") the embed stays silent. - Every message is an object `{ type: "teamsync:", ...payload }`. Requests (host page → app): - `teamsync:make`: Make teams from these names (the names box shows them, then the result is posted back). - `names` (string[], required, ≤ 1,000 names, each ≤ 100 characters; blank entries are ignored; whole message ≤ 120,000 characters): The people to split. - `teams` (number (integer), required, 2–10): How many teams to make. Events (app → host page): - `teamsync:ready`: TeamSync is loaded and listening for teamsync:make. - (no fields) - `teamsync:result`: The teams were made (after teamsync:make or a tap on Generate teams / Shuffle again). - `teams` (string[][], required): One array of names per team; sizes differ by at most one, bigger teams first. - `teamsync:error`: The teams could not be made. - `code` (string, required): NAMES_EMPTY | NAMES_TOO_MANY | NAME_TOO_LONG | NAMES_INVALID | TEAMS_OUT_OF_RANGE | TEAMS_MORE_THAN_NAMES ## HTTP API - none: there is no HTTP API (the app runs in the browser; agents use the MCP server) ## MCP - Local (stdio): npx -y @simeonts/teamsync-random-team-generator-mcp - Client config: {"mcpServers":{"teamsync-random-team-generator":{"command":"npx","args":["-y","@simeonts/teamsync-random-team-generator-mcp"]}}} ### Tool `make_teams` Split a list of people into 2–10 fair, random teams (sizes differ by at most 1; unbiased crypto shuffle). Read-only, no network. Input (arguments): - `names` (string[] | string, required, array: ≤ 1,000 names, each ≤ 100 characters · text: ≤ 110,000 characters, one name per line; numbers, bullets and chat prefixes are removed): People to split: an array of names, or text with one name per line. - `teams` (number (integer), required, 2–10, not more than the number of names): Number of teams. Output (structuredContent; the text content holds the same result for people): - `teams` (string[][], required): One array of names per team (the text content has the same teams ready to paste into a chat). Errors: isError: true with text content {"code","message"}; codes INPUT_INVALID, NAMES_EMPTY, NAMES_TOO_MANY, NAME_TOO_LONG, NAMES_INVALID, TEAMS_OUT_OF_RANGE, TEAMS_MORE_THAN_NAMES. Example call: - arguments: {"names":["Maria","Liam","Aisha","Kenji","Elena"],"teams":2} - structuredContent: {"teams":[["Kenji","Maria","Elena"],["Aisha","Liam"]]} ## Limits - Max items: 1000 ## Languages - UI: en, bg (English is the default). ## How to use (steps) 1. Type or paste the names, one per line. 2. Choose how many teams with − and +. 3. Tap “Generate teams”. 4. Not happy? Tap “Shuffle again” — then Copy or Share the teams. ## Features - Fair shuffle: Every possible split is equally likely (Fisher–Yates with your device's secure random numbers). Team sizes differ by at most one, bigger teams first. - Remembers your list: Your last names list and number of teams stay on this device, so a weekly game is one tap. Clear removes the list (with Undo); Settings → Clear my data removes everything. - Copy, Share and WhatsApp: Copy gives a ready-to-paste text for any chat; Share opens your phone's share sheet; WhatsApp opens a new message with the teams (WhatsApp Web on a computer). - Bring a list from a chat: Paste a list from WhatsApp, Viber or notes — numbers, bullets, emoji and “[time] Name:” prefixes are removed automatically. On Android you can also select the message, tap Share and choose TeamSync (after installing it). - Link with the number of teams: Links like ?teams=3 open TeamSync with 3 teams selected. Names are never part of a link. - Works offline: After the first visit TeamSync works without internet; install it to open it like an app. - Keyboard: Ctrl+Enter (⌘+Enter on a Mac) in the names box makes the teams; Tab moves through every control. ## FAQ ### Is TeamSync free? Yes. It is free and open source (MIT licence), with no ads and no sign-up. ### Are the teams really fair? Yes. TeamSync uses the Fisher–Yates shuffle with your device's secure random numbers, so every split is equally likely. Team sizes differ by at most one. ### Are the names sent anywhere? No. Everything is computed in your browser on your device. Names are not uploaded and are never put in links. ### How many names and teams can I use? Up to 1,000 names and 2 to 10 teams. A name can have up to 100 characters; duplicate names are allowed. ### Does it work offline? Yes, after the first visit. You can also install it on your phone or computer to open it like an app. ### How do I send the teams to my group chat? Tap WhatsApp for a new message with the teams, Share to pick any other app, or Copy and paste the text anywhere. ### Can I take the list from WhatsApp? Yes. Copy the message with the list and paste it — TeamSync keeps only the names. On Android: install TeamSync, then in WhatsApp choose Share → TeamSync. ### Can an AI agent make teams with TeamSync? Yes. The local MCP server (npx -y @simeonts/teamsync-random-team-generator-mcp) provides the make_teams tool: give it the names and the number of teams, and it returns the teams. ## Privacy - In the browser, what you type or paste is processed on the device and never uploaded. No accounts, cookies, tracking or analytics. ## About - Licence: MIT · Source: https://github.com/SimeonTsvetanov/teamsync-random-team-generator · Author: Simeon Tsvetanov · Support: https://buymeacoffee.com/simeontsvetanov