{"tools":[{"type":"function","function":{"name":"auth","description":"Sign in to b59.link to own what you create (and for 300 requests/minute on the REST API). Pass api_key to get a session key straight away. Or pass email to have a 6-digit code emailed, then call again with email and otp to get a session key (new emails are signed up and also get their api_key). Send the session key as the HTTP header 'Authorization: Bearer <session_key>'.","parameters":{"type":"object","properties":{"api_key":{"type":"string","description":"The account's 256-character API key."},"email":{"type":"string","description":"Email to send a one-time code to."},"otp":{"type":"string","description":"The 6-digit code from the email."}}}}},{"type":"function","function":{"name":"shorten_url","description":"Shorten a long URL and get a memorable b59.link short URL. Optionally specify a custom slug. Returns the short URL and a stats URL.","parameters":{"type":"object","properties":{"url":{"type":"string","description":"The URL to shorten."},"slug":{"type":"string","description":"Optional custom slug (letters, digits, hyphens, underscores, max 100 chars). A random slug is used if omitted."}},"required":["url"]}}},{"type":"function","function":{"name":"generate_qr","description":"Generate a trackable QR code for a URL. Creates a b59.link short URL at the same time so scans are counted. Returns the short URL, a stats URL, and the QR code as a base64-encoded PNG.","parameters":{"type":"object","properties":{"url":{"type":"string","description":"The URL to generate a QR code for."}},"required":["url"]}}},{"type":"function","function":{"name":"create_tracker","description":"Create a free page-view tracker for a website. Returns the tag image URL and ready-to-paste snippets for the site's pages, plus the stats URL where views, visitors, pages and referrers are shown. When signed in, the tracker belongs to the account; otherwise keep the manage_token to claim it later.","parameters":{"type":"object","properties":{"site_url":{"type":"string","description":"The site's address, e.g. example.com. Views are only counted on this domain and its subdomains."},"name":{"type":"string","description":"Optional display name for the tracker."}},"required":["site_url"]}}},{"type":"function","function":{"name":"get_stats_url","description":"Get the stats page URL for anything b59.link tracks: a slug or short URL, the destination URL of a short link or QR code, a tracker id or tag URL, or any page URL / domain that has a tracker tag. Stats themselves are viewed on b59.link; this returns where.","parameters":{"type":"object","properties":{"identifier":{"type":"string","description":"Slug, short URL, page URL, domain, tracker id or tag URL."}},"required":["identifier"]}}},{"type":"function","function":{"name":"lookup_url","description":"Check whether a URL already has a b59.link short URL. Handles variations: http/https, www prefix, trailing slash. Returns the existing short URL and QR code if found.","parameters":{"type":"object","properties":{"url":{"type":"string","description":"The URL to look up."}},"required":["url"]}}},{"type":"function","function":{"name":"make_qr_image","description":"Make a QR code image for any text (URL, Wi-Fi string, phone, email, plain text) without creating a short link. Supports colors, size and SVG. Returns the image plus a permanent image URL that can be embedded with <img src>. Use generate_qr instead when scans should be counted.","parameters":{"type":"object","properties":{"data":{"type":"string","description":"Text to encode (max 1500 chars)."},"size":{"type":"integer","description":"Width/height in pixels, 64-1200 (default 300)."},"fg":{"type":"string","description":"Foreground hex color, e.g. 000000."},"bg":{"type":"string","description":"Background hex color, e.g. ffffff."},"format":{"type":"string","enum":["png","svg"],"description":"Image format (default png)."}},"required":["data"]}}},{"type":"function","function":{"name":"watch_printed_links","description":"Watch up to 25 printed links (QR codes on menus, short links on flyers, posters, packaging, cards). Checks each one now and then once a day, and records the whole redirect chain. A link is flagged when it dies (fails twice, 6 hours apart), lands somewhere new, lands on a QR or short-link vendor's 'deactivated' page or a parked domain, changes how it redirects, or its certificate expires within 14 days. Returns the first results, page_url (a result page to hand to the person; shareable) and manage_url (private: edit, re-check, delete). No key needed.","parameters":{"type":"object","properties":{"links":{"type":"array","minItems":1,"maxItems":25,"items":{"type":"object","properties":{"url":{"type":"string","description":"The printed link, e.g. https://example.com/menu."},"label":{"type":"string","description":"Where it is printed, e.g. 'menu table card'."}},"required":["url"]}},"email":{"type":"string","description":"Optional address for alerts; nothing is sent to it until it is confirmed with a code on the result page."}},"required":["links"]}}},{"type":"function","function":{"name":"get_watch_report","description":"Get the state of every link in a printed-link watch: working, dead, moved, deactivated page, redirect changed or certificate expiring, what changed since the first check, the latest redirect chain and the last 30 days.","parameters":{"type":"object","properties":{"slug":{"type":"string","description":"The watch's slug or its page_url (b59.link/w/<slug>)."}},"required":["slug"]}}}]}