{"id":"tables_schema","name":"Tables Schema","alias":"TablesSchema","aliases":[],"description_short":"Agent that retrieves the schema (field names and types) for a given table","description_long":"List all fields from a given table, including enum values when known.","description_tool_prompt":"List all fields (names, types, and enum values when known) from a given table. When a field has `enum`, use those values in filters. If `bitmask` is true, test nonzero flags with `column & value != 0` (values are combinable); for a zero/no-flags value, use `column = 0`. When a `*_name` / `*Name` column follows an id column (e.g. `bot_name` for `bot_id`), use it to display or group by names instead of writing CASE mappings. A field name containing `{a|b|...}` groups is a compact notation for several columns sharing the same type and mode: expand every group (cartesian product) to get the real column names, e.g. `x__{a|b}__{c|d}` stands for `x__a__c`, `x__a__d`, `x__b__c` and `x__b__d`. Use the expanded names in SQL, never the braces. A table growing without bound over time (Search Console, analytics reports, served pages...) comes with a `time_filter`: the column, its type, an example and, when known, the first and last days with data in the project (`date_start`, `date_end`). tables_query rejects a query reading such a table unless a comparison on that column bounds it in the WHERE clause of the SELECT reading it (a filter on a CTE or subquery wrapping the table does not count).","source":null,"conversation_examples":[],"tags":[],"available_in_chat":true,"available_in_deepthink":true,"available_in_mcp":true,"mcp_audience":"all","config":{"type":"object","properties":{},"required":[]},"item":{"type":"object","properties":{"table_name":{"description":"Name of the table to get schema for. Wildcard not allowed.","title":"Table Name","type":"string"}},"required":["table_name"]},"response":{"$defs":{"RetentionFloor":{"description":"Oldest data a table serves, the same as everywhere else in Botify.","properties":{"column":{"description":"Column the floor applies to","title":"Column","type":"string"},"date":{"description":"Oldest date served: data before it is no longer served","format":"date","title":"Date","type":"string"}},"required":["column","date"],"title":"RetentionFloor","type":"object"},"TableField":{"properties":{"name":{"title":"Name","type":"string"},"type":{"title":"Type","type":"string"},"mode":{"default":"nullable","description":"`repeated` or `required`; omitted when `nullable` (the default)","title":"Mode","type":"string"},"fields":{"anyOf":[{"items":{"$ref":"#/$defs/TableField"},"type":"array"},{"type":"null"}],"default":null,"title":"Fields"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Optional documentation for this field","title":"Description"},"enum":{"anyOf":[{"items":{"$ref":"#/$defs/TableFieldEnumValue"},"type":"array"},{"type":"null"}],"default":null,"description":"Known discrete values for this field. Each entry has value, name, and optional extra; for name columns, entries only carry value. Absent when the field is not an enum.","title":"Enum"},"bitmask":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"description":"If true, enum values are combinable flags. Test a nonzero flag with `column & value != 0`; for a zero/no-flags value, use `column = 0`.","title":"Bitmask"}},"required":["name","type"],"title":"TableField","type":"object"},"TableFieldEnumValue":{"description":"One known discrete value of a table field (regular enum or bitmask flag).","properties":{"value":{"anyOf":[{"type":"integer"},{"type":"string"}],"title":"Value"},"name":{"title":"Name","type":"string"},"extra":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Extra"}},"required":["value","name"],"title":"TableFieldEnumValue","type":"object"},"TimeFilter":{"description":"Column a query must filter on to read a table that grows without bound over time.","properties":{"column":{"description":"Column to filter on in the WHERE clause of the SELECT reading the table, or the query is rejected","title":"Column","type":"string"},"type":{"description":"BigQuery type of the column","title":"Type","type":"string"},"example":{"description":"Example of such a filter","title":"Example","type":"string"},"date_start":{"anyOf":[{"format":"date","type":"string"},{"type":"null"}],"default":null,"description":"First day with data in the project. Absent when unknown.","title":"Date Start"},"date_end":{"anyOf":[{"format":"date","type":"string"},{"type":"null"}],"default":null,"description":"Last day with data in the project. Absent when unknown.","title":"Date End"}},"required":["column","type","example"],"title":"TimeFilter","type":"object"}},"properties":{"table_name":{"description":"Name of the table","title":"Table Name","type":"string"},"fields":{"description":"List of field definitions with name, type, and enum values when known. A field name containing `{a|b|...}` groups is a compact notation for several columns sharing the same type and mode: expand every group (cartesian product) to get the real column names, e.g. `x__{a|b}__{c|d}` stands for `x__a__c`, `x__a__d`, `x__b__c` and `x__b__d`. Use the expanded names in SQL, never the braces.","items":{"$ref":"#/$defs/TableField"},"title":"Fields","type":"array"},"found":{"description":"Whether the table was found in the available tables","title":"Found","type":"boolean"},"time_filter":{"anyOf":[{"$ref":"#/$defs/TimeFilter"},{"type":"null"}],"default":null,"description":"Set when the table grows without bound over time: a query reading it must filter on this column, or it is rejected. Absent otherwise."},"retention_floor":{"anyOf":[{"$ref":"#/$defs/RetentionFloor"},{"type":"null"}],"default":null,"description":"Set when this table only serves part of its history: data before this date is no longer served, here or anywhere else in Botify, and a query asking for it comes back empty. Absent when the whole table is served."}},"required":["table_name","fields","found"],"title":"TablesSchemaProcessedItem","type":"object"},"has_canvas":false,"open_canvas_automatically":false}