{
  "slug": "query-result-formatter",
  "name": "gizza-ai/query-result-formatter",
  "version": "0.1.0",
  "title": "Query Result Formatter — gizza.ai",
  "description": "Turn raw query result rows — a JSON array, CSV, or TSV — into a clean, aligned Markdown or ASCII table for docs and chat.",
  "tags": [
    "json",
    "csv",
    "sql",
    "table"
  ],
  "category": "data",
  "urls": {
    "page": "https://gizza.ai/tools/query-result-formatter/",
    "markdown": "https://gizza.ai/tools/query-result-formatter/index.md",
    "descriptor": "https://gizza.ai/tools/query-result-formatter/tool.json",
    "deep_link_example": "https://gizza.ai/tools/query-result-formatter/?data=%5B%7B%22id%22%3A1%2C%22name%22%3A%22Ada%22%7D%2C%7B%22id%22%3A2%2C%22name%22%3A%22Linus%22%7D%5D&input_format=auto&format=markdown&header=true&align=left&null_text=e.g.%20NULL"
  },
  "cli": "gizza tool query-result-formatter '[{\"id\":1,\"name\":\"Ada\"},{\"id\":2,\"name\":\"Linus\"}]'",
  "tool": {
    "description": "Render raw query result rows into a clean, aligned table for docs and chat. data is a JSON array of row objects (columns = the object keys, unioned across rows; missing keys become null_text), a JSON array of arrays, a single JSON row object, CSV, TSV, or a psql/MySQL/SQLite CLI result table (pipe columns with +---+/---+--- rules and a (N rows) footer). input_format=auto (default) sniffs JSON vs a SQL CLI table vs TSV vs CSV. format=markdown (default) emits a GitHub-style pipe table; format=ascii emits a box-drawing grid. header (default true) treats the first CSV/TSV/array row as the header. align is left/right/center. null_text sets how JSON nulls / missing values render (default empty). Runs locally.",
    "parameters": {
      "additionalProperties": false,
      "properties": {
        "align": {
          "default": "left",
          "description": "Column text alignment: left (default), right or center.",
          "enum": [
            "left",
            "right",
            "center"
          ],
          "type": "string"
        },
        "data": {
          "description": "The raw query result rows: a JSON array of row objects (or arrays), CSV, or TSV text.",
          "type": "string"
        },
        "format": {
          "default": "markdown",
          "description": "Output table format: markdown (default, GitHub-style pipe table) or ascii (box-drawing grid).",
          "enum": [
            "markdown",
            "ascii"
          ],
          "type": "string"
        },
        "header": {
          "default": true,
          "description": "For CSV/TSV and JSON arrays-of-arrays, treat the first row as the header (default true); otherwise 'Column N' headers are generated. JSON arrays-of-objects always use the object keys.",
          "type": "boolean"
        },
        "input_format": {
          "default": "auto",
          "description": "Shape of the input: auto (default — sniffs JSON vs SQL-CLI-table vs TSV vs CSV), json, csv, tsv, or sql (a psql/MySQL/SQLite result table pasted from a database shell — pipe columns, +---+/---+--- rules and the (N rows) footer are handled).",
          "enum": [
            "auto",
            "json",
            "csv",
            "tsv",
            "sql"
          ],
          "type": "string"
        },
        "null_text": {
          "default": "",
          "description": "Text to render for a JSON null / missing column value (default empty). Set to e.g. 'NULL' to mark database nulls.",
          "type": "string"
        }
      },
      "required": [
        "data"
      ],
      "type": "object"
    }
  }
}