{
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "resqlable_schema",
        "description": "Return the tables, columns and types of a ReSQLable dataset. Call this before writing SQL so column names are correct.",
        "parameters": {
          "type": "object",
          "properties": {
            "dataset": {
              "type": "string",
              "description": "Dataset id, for example 'airports'."
            }
          },
          "required": ["dataset"]
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "resqlable_query",
        "description": "Run exactly one read-only SELECT or WITH statement against a ReSQLable dataset and return rows as JSON. Results are capped by the caller's plan; check the 'truncated' field.",
        "parameters": {
          "type": "object",
          "properties": {
            "dataset": {
              "type": "string",
              "description": "Dataset id, for example 'airports'."
            },
            "sql": {
              "type": "string",
              "description": "A single read-only SQL statement. No semicolon-separated statements, no writes, no ATTACH or PRAGMA."
            },
            "format": {
              "type": "string",
              "enum": ["objects", "arrays"],
              "default": "objects",
              "description": "Use 'arrays' together with the returned 'columns' to save tokens."
            }
          },
          "required": ["dataset", "sql"]
        }
      }
    }
  ]
}
