check_dashboard_queries
ChatGPTCheck a tab's queries before saving the template that carries them. The names in a query are only resolved when a page is rendered, so without this the first reader of the dashboard is the one who discovers that sales cannot be grouped by a labour dimension, or that no logbook has the name the template asked for. Each query is answered under its own key: whether it works, why not if it doesn't, and the columns a row will carry — which you need in order to write the markup that formats them. count_rows=True also runs them, and reports how many rows each found: a query can be perfectly valid and still leave a blank card. Pass the business_id from your most recent get_analytics_context call.
create_card
ChatGPTPersist a new insight card to the user's account. Use this ONLY when the user EXPLICITLY asks to create / save / build / pin / add a card. For one-off data questions ("get sales yesterday", "show me X"), use query_metrics instead — do NOT persist a card just to answer a question. Returns the created card plus an inline visual preview by default. The system automatically selects the best underlying data view. Pass the business_id from your most recent get_analytics_context call. If you pass calculated_columns, FIRST call get_calculated_column_functions() for the exact function names, argument signatures and examples — only use what it returns.
create_card
ChatGPTPersist a new insight card to the user's account. Use this ONLY when the user EXPLICITLY asks to create / save / build / pin / add a card. For one-off data questions ("get sales yesterday", "show me X"), use query_metrics instead — do NOT persist a card just to answer a question. Returns the created card plus an inline visual preview by default. The system automatically selects the best underlying data view. Pass the business_id from your most recent get_analytics_context call. If you pass calculated_columns, FIRST call get_calculated_column_functions() for the exact function names, argument signatures and examples — only use what it returns.
create_dashboard
ChatGPTPersist a new dashboard containing cards grouped by tabs. Use this ONLY when the user EXPLICITLY asks to create / save / build a dashboard. Do NOT auto-create a dashboard just because the user asked for several metrics — return data via query_metrics and ask whether they want a dashboard. Returns the created dashboard plus an inline visual preview of all cards by default. Pass the business_id from your most recent get_analytics_context call.
create_dashboard
ChatGPTPersist a new dashboard containing cards grouped by tabs. Use this ONLY when the user EXPLICITLY asks to create / save / build a dashboard. Do NOT auto-create a dashboard just because the user asked for several metrics — return data via query_metrics and ask whether they want a dashboard. Returns the created dashboard plus an inline visual preview of all cards by default. Pass the business_id from your most recent get_analytics_context call.
get_analytics_context
ChatGPTGet currency, timezone, week start day, and date periods for translating relative dates. Call this at the start of every conversation.
get_analytics_context
ChatGPTGet currency, timezone, week start day, and date periods. Call this at the start of every conversation. Each date period lists a code (e.g. "WTD", "L7D", "MTD") to pass as the query_metrics period; it carries no absolute dates, so the server always resolves them from the current date.
get_available_dimensions
ChatGPTGet all available dimensions for grouping metric queries. Pass the business_id from your most recent get_analytics_context call.
get_available_dimensions
ChatGPTGet all available dimensions for grouping metric queries. Pass the business_id from your most recent get_analytics_context call.
get_available_filters
ChatGPTGet all available filters for metric queries. Pass the business_id from your most recent get_analytics_context call.
get_available_filters
ChatGPTGet all available filters for metric queries. Pass the business_id from your most recent get_analytics_context call.
get_available_metrics
ChatGPTGet all available metrics that can be queried. Pass the business_id from your most recent get_analytics_context call.
get_available_metrics
ChatGPTGet all available metrics that can be queried. Pass the business_id from your most recent get_analytics_context call.
get_calculated_column_functions
ChatGPTList the functions and operators usable in a calculated-column formula. Returns functions (each with its name, argument signature, an example, and needs_dimension/variadic flags) and operators. Only the listed functions are supported, with the argument counts shown; a function flagged needs_dimension needs a dimension column (e.g. location, date) as an argument. Call this before writing a calculated_columns formula for create_card.
get_calculated_column_functions
ChatGPTList the functions and operators usable in a calculated-column formula. Returns functions (each with its name, argument signature, an example, and needs_dimension/variadic flags) and operators. Only the listed functions are supported, with the argument counts shown; a function flagged needs_dimension needs a dimension column (e.g. location, date) as an argument. Call this before writing a calculated_columns formula for create_card.
get_card
ChatGPTFetch an existing insight card by its meta_card_id, with an inline visual preview.
get_card
ChatGPTFetch an existing insight card by its meta_card_id, with an inline visual preview.
get_dashboard
ChatGPTFetch an existing dashboard by its dashboard_id, with an inline visual preview of every card in every tab.
get_dashboard
ChatGPTFetch an existing dashboard by its dashboard_id, with an inline visual preview of every card in every tab.
get_dashboard_kit
ChatGPTFetch what a dashboard's tabs are built from: the Tenzo CSS classes, the colour and spacing tokens, the JavaScript helpers available to the page, and a worked example. Call this before writing or editing a tab's template. The renderer supplies the stylesheet, the Tenzo typeface and these helpers, so a template written against them looks like the rest of Tenzo, follows the business's own palette, and spends none of its 256KB budget on any of it. Returns: version, classes, tokens, runtime (the helper signatures), notes (the rules a template has to obey) and example (a complete template that uses all of it).
get_filter_values
ChatGPTThe values a filterable field actually takes for this business. Use it to choose a filter value rather than guess one: ask for the order types before filtering to "Delivery". Reads the last 90 days, capped at 200 values, and says whether it was capped. Pass the business_id from your most recent get_analytics_context call.
get_locations
ChatGPTGet the list of locations for the current business, including custom field labels and per-location values. custom_field_1/2/3 are per-location numeric attributes. Their human-readable labels (e.g. 'Income', 'Rent', 'COGS %') live on the business as custom_field_N_name. Call this when the user names a non-standard per-location attribute that is not one of the standard dimensions — map the human name to custom_field_N via its label, then use the per-location value for any calculation. Pass the business_id from your most recent get_analytics_context call.
get_locations
ChatGPTGet the list of locations for the current business, including custom field labels and per-location values. custom_field_1/2/3 are per-location numeric attributes. Their human-readable labels (e.g. 'Income', 'Rent', 'COGS %') live on the business as custom_field_N_name. Call this when the user names a non-standard per-location attribute that is not one of the standard dimensions — map the human name to custom_field_N via its label, then use the per-location value for any calculation. Pass the business_id from your most recent get_analytics_context call.
get_target_data
ChatGPTGet the day-level values of one target set (from list_targets), optionally filtered by date range (YYYY-MM-DD) and location_id. target_set_id and location_id are STRINGS — pass them exactly as returned by list_targets (ids exceed safe integer precision in JavaScript, so they must never be handled as numbers). Rows have date, location_id, location_name, dimensions (the target's custom breakdown values, e.g. {"day_part": "Lunch"}) and value. Values are always stored per day: total a "sum" target by adding values; for a "mean" target average them (see aggregation on list_targets). Use this to answer questions about the target itself ("what's my sales target this month?") or to compare against actuals fetched with query_metrics over the same dates. To persist a card comparing actuals vs target, use create_card with target_set_id instead. Pass the business_id from your most recent get_analytics_context call.
get_target_dimension_values
ChatGPTGet the canonical values Tenzo stores for one or more target dimensions, so you can map a user's spreadsheet cell values onto them. dimension_keys: a list of keys from get_target_dimensions (e.g. ["day_part"]). Returns {dim_key: [canonical values]} (e.g. {"day_part": ["Breakfast", "Lunch", "Dinner"]}). Map each user value (e.g. "Morning") to the closest canonical value (e.g. "Breakfast"); if there is no clear match, ask the user — never invent one. load_target rejects values not in this set. Pass the business_id from your most recent get_analytics_context call.
get_target_dimensions
ChatGPTList the dimensions a target can be broken down by for this business. Each entry has a key (use in load_target's dimensions and in each value row's dimensions) and a display_name. Use this to map a user's spreadsheet dimension column header (e.g. "Daypart") onto a Tenzo dimension key (e.g. "day_part"), then call get_target_dimension_values to map the cell values. Only use a key returned here; if a column has no clear match, ask the user rather than guessing. Pass the business_id from your most recent get_analytics_context call.
get_target_metrics
ChatGPTList the metrics you can set a target/budget on for this business. Each entry has key (use as load_target's metric_key), display_name, default distribution, formatter, and an available flag. Use this to map a user's value column (e.g. "Net Sales") onto a Tenzo metric_key (e.g. "sales") before calling load_target — only use a key returned here. This is the curated TARGET metric set; it differs from get_available_metrics (which lists query metrics). Pass the business_id from your most recent get_analytics_context call.
list_businesses
ChatGPTList every business the authenticated user can access. Each entry has a numeric value (business_id) and a human-readable label. The response also carries the currently-active business_id and business_name at the top level — use these in subsequent tool calls.
list_businesses
ChatGPTList every business the authenticated user can access. Each entry has a numeric value (business_id) and a human-readable label. The response also carries the currently-active business_id and business_name at the top level — use these in subsequent tool calls.
list_logbooks
ChatGPTList logbook templates with their associated locations. Pass the business_id from your most recent get_analytics_context call.
list_logbooks
ChatGPTList logbook templates with their associated locations. Pass the business_id from your most recent get_analytics_context call.
list_logs
ChatGPTList manager logs, optionally filtered by location, logbook, and date range. Pass the business_id from your most recent get_analytics_context call.
list_logs
ChatGPTList manager logs, optionally filtered by location, logbook, author, and date range. logbook_id is a STRING — keep it as one (ids exceed safe integer precision in JavaScript). To pull answers to specific questions, call list_logbooks first and pass exact section titles as section and field names as field; an answer matching any of them is kept, and full_text then contains only matching answers. exclude_blank drops unanswered fields. Pass the business_id from your most recent get_analytics_context call.
list_reviews
ChatGPTList customer reviews, optionally filtered by location and date range. Pass the business_id from your most recent get_analytics_context call.
list_reviews
ChatGPTList customer reviews, optionally filtered by location and date range. Pass the business_id from your most recent get_analytics_context call.
list_targets
ChatGPTList the business's performance targets (also called budgets): named sets of target values for one metric (e.g. a sales budget), stored per day and location. Call this whenever the user mentions targets, budgets, goals, or asks how they are doing "vs target" / "vs budget". Returns empty results when the business has no targets. Each target set in results includes: - id: a STRING — keep it as one (ids exceed safe integer precision in JavaScript). Pass it as create_card's target_set_id to put the target on a card, or as get_target_data's target_set_id. - target_metric: the column name of the target values (e.g. "target_sales"). Valid in create_card's metrics array and in calculated-column formulas — but ONLY when target_set_id is also set. NOT valid in query_metrics. - actuals_formula: the actual metric being targeted, as a formula over card columns (e.g. "sales", or "sales / ticket_count" for ATV). - suggested_delta_formula: a ready-made "% vs target" calculated-column formula comparing actuals to target. - aggregation: how target values combine over days/locations — "sum" (amount, e.g. sales) or "mean" (a level to hold, e.g. a ratio). - start_date / end_date: the first and last day the target covers. Outside it the target columns are empty, so keep card date filters within this range. - dimensions: extra breakdowns the target was uploaded with (e.g. {"day_part": "Day part"}). Empty {} means location/date only. - locations: the locations the target applies to. To read the raw target numbers, call get_target_data with the target set's id. Pass the business_id from your most recent get_analytics_context call.
list_weather
ChatGPTList daily weather per location — temperature, wind, humidity and precipitation. One reading per location per day: an observation for days past, the latest forecast for days ahead. Temperatures are Celsius, wind m/s, rainfall mm/h. Pass the business_id from your most recent get_analytics_context call.
load_target
ChatGPTCreate one or more performance targets (a.k.a. budgets) with their values and build the comparison card(s). Use this when the user asks to set, load, upload, or import a target/budget — often from an attached CSV/XLSX or pasted table. You provide values at the target's INTERVAL granularity (one number per bucket × location × dimension-combo, e.g. one per week); the server distributes them to days, registers the target, and builds the card. BEFORE calling, resolve every label in the user's data to Tenzo's canonical identifiers — Core matches EXACTLY and rejects unknown labels: - location → location_id: get_locations, map the user's name (e.g. "london") to the right id (e.g. "1. London"). Pass ids as STRINGS. - value column → metric_key: get_target_metrics (e.g. "Net Sales" → "sales"). - dimension header → dim_key: get_target_dimensions (e.g. "Daypart" → "day_part"). - dimension cell → canonical value: get_target_dimension_values (e.g. "Morning" → "Breakfast"). If a label has no confident match, ASK the user — never invent one. Then echo a short mapping + totals summary and confirm before calling.
query_metrics
ChatGPTQuery a single business metric for a date range, optionally grouped by dimensions and filtered. Pass the business_id from your most recent get_analytics_context call. If the response contains 0 rows, check query_info.filters_applied to verify your filter values are correct. Common causes of empty results: - A filter value that doesn't match any data (e.g. wrong location name). Try querying with fewer filters or without filters to discover valid values. - A date range with no activity. Do NOT assume a 0-row result means a dimension/filter combination is unsupported.
query_metrics
ChatGPTQuery a single business metric over a period, optionally grouped by dimensions and filtered. Pass the business_id from your most recent get_analytics_context call. period is required. For a relative range pass a code from get_analytics_contex (e.g. "WTD", "L7D", "MTD", "YTD"). The server resolves it to the current dates, so never compute or reuse dates yourself. For an explicit calendar range the user gives, pass period="custom" with start_date and end_date (YYYY-MM-DD). Each filter is {"field": <a field from get_available_filters>, "operator": <operator>, "value": <a value, or a list of values for in/nin>}. When query_info.fields is present, label each column with its display_name. If the response contains 0 rows, check query_info.filters_applied to verify your filter values are correct. Common causes of empty results: - A filter value that doesn't match any data (e.g. wrong location name). Try querying with fewer filters or without filters to discover valid values. - A date range with no activity. Do NOT assume a 0-row result means a dimension/filter combination is unsupported.
replace_target_data
ChatGPTOverwrite ALL values (and period / locations / dimensions) of an existing target set with new data, preserving the prior state as a restorable version. Use this when the user wants to update or replace an existing target's numbers, or after a load_target TARGET_NAME_CONFLICT (pass its existing_target_set_id). target_set_id is a STRING (from list_targets or a conflict response). Resolve labels first and shape values exactly as in load_target — but this is single-metric: metric_name is the target's display name, and each value row's values dict is keyed by it, e.g. {"date": "...", "location_id": "...", "dimensions": {...}, "values": {"Sales budget": 7000}}. start_date / end_date follow load_target: the first day of the first bucket and the LAST day of the last one. Pass the business_id from your most recent get_analytics_context call.
submit_log
ChatGPTSubmit a manager log to a logbook, authored by the current user. BEFORE calling, call list_logbooks and use its exact section titles and field names. logbook_id and location_id are STRINGS — keep them as strings (ids exceed safe integer precision in JavaScript); location_id must be one of the logbook's location_ids. field_values shape: - section title → list of {field name: value} dicts, one dict per entry; - a sectionless field name, or the title of a section whose single field is unnamed ("") → a string. e.g. {"Opening checks": [{"Fridge temp": "4C", "Notes": "All fine"}], "Manager notes": "Quiet lunch"} date_of_business is YYYY-MM-DD; omit it for today. Echo back the logbook, location, date and field values you will submit and get the user's confirmation before calling. Returns the created log. A 400 with unmatched lists names that matched no section or field, and hints the sections a bare field name lives in — use them to correct the names and retry rather than guessing. A 403 means the user can't access that location or logbook. After any other error, call list_logs for that logbook, location and date before resubmitting — the log may already have been written. Pass the business_id from your most recent get_analytics_context call.
switch_business
ChatGPTChange the active business for all subsequent tool calls. Returns the new business_id and business_name — use these for subsequent calls. After switching, re-call get_analytics_context: currency, timezone, week start and date_periods are business-specific.
switch_business
ChatGPTChange the active business for all subsequent tool calls. Returns the new business_id and business_name — use these for subsequent calls. After switching, re-call get_analytics_context: currency, timezone, week start and date_periods are business-specific.