Skip to main content
Glama

Export report (CSV)

export_report
Read-only

Export one saved analysis's results as CSV through the single audited egress path. Pass report_id for a saved analysis or an inline ReportSpec; returns the CSV text + row count + filename. A dashboard is not one CSV: choose a linked panel's source analysis or an inline panel's spec. Every export is recorded (a report_runs row + an audit_log report.export event).

When to use: Export one saved analysis or an inline ReportSpec as CSV. A dashboard needs a panel chosen first; it is not exported as one table. Every export is logged for governance.

Example: Export the ARR-by-industry report as a CSV.

Input Schema

NameRequiredDescriptionDefault
report_idNoA saved analysis's id (uuid) to export; give this or definition (report_id wins when both are passed). A dashboard or segment id is refused.
definitionNoAn inline ReportSpec for a single analysis (not a dashboard) to export without saving it — the same shape as the ReportSpec variant of run_report's definition; omit when passing report_id.

Output Schema

NameRequiredDescriptionDefault
csvNo
formatNo
filenameNo
row_countNo
truncatedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • removedInput schema / $schema
      Removed value: -"https://json-schema.org/draft/2020-12/schema"
  2. Changed1 schema field changed
    • removedInput schema / properties / report_id / pattern
      Removed value: -"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
  3. Changed2 schema fields changed
    • removedOutput schema / $schema
      Removed value: -"https://json-schema.org/draft/2020-12/schema"
    • removedOutput schema / additionalProperties
      Removed value: -{}
  4. Changed4 schema fields changed
    • changedInput schema / properties / definition / description
      Previous value: -"An inline ReportSpec for a single analysis (not a dashboard) to export without saving it; omit when passing report_id."New value: +"An inline ReportSpec for a single analysis (not a dashboard) to export without saving it — the same shape as the ReportSpec variant of run_report's definition; omit when passing report_id."
    • removedInput schema / properties / definition / properties
      Removed value: -{
      -  "aggregations": {
      -    "default": [],
      -    "items": {
      -      "properties": {
      -        "alias": {
      -          "minLength": 1,
      -          "type": "string"
      -        },
      -        "fn": {
      -          "enum": [
      -            "count",
      -            "count_distinct",
      -            "sum",
      -            "avg",
      -            "min",
      -            "max"
      -          ],
      -          "type": "string"
      -        },
      -        "ref": {
      -          "oneOf": [
      -            {
      -              "properties": {
      -                "field": {
      -                  "minLength": 1,
      -                  "type": "string"
      -                },
      -                "kind": {
      -                  "const": "field",
      -                  "type": "string"
      -                }
      -              },
      -              "required": [
      -                "kind",
      -                "field"
      -              ],
      -              "type": "object"
      -            },
      -            {
      -              "properties": {
      -                "key": {
      -                  "minLength": 1,
      -                  "type": "string"
      -                },
      -                "kind": {
      -                  "const": "custom",
      -                  "type": "string"
      -                }
      -              },
      -              "required": [
      -                "kind",
      -                "key"
      -              ],
      -              "type": "object"
      -            },
      -            {
      -              "properties": {
      -                "kind": {
      -                  "const": "related",
      -                  "type": "string"
      -                },
      -                "path": {
      -                  "minLength": 1,
      -                  "type": "string"
      -                }
      -              },
      -              "required": [
      -                "kind",
      -                "path"
      -              ],
      -              "type": "object"
      -            }
      -          ]
      -        },
      -        "where": {
      -          "items": {
      -            "properties": {
      -              "op": {
      -                "enum": [
      -                  "eq",
      -                  "neq",
      -                  "gt",
      -                  "gte",
      -                  "lt",
      -                  "lte",
      -                  "contains",
      -                  "starts_with",
      -                  "in",
      -                  "not_in",
      -                  "has_any",
      -                  "in_period",
      -                  "is_null",
      -                  "is_not_null"
      -                ],
      -                "type": "string"
      -              },
      -              "ref": {
      -                "oneOf": [
      -                  {
      -                    "properties": {
      -                      "field": {
      -                        "minLength": 1,
      -                        "type": "string"
      -                      },
      -                      "kind": {
      -                        "const": "field",
      -                        "type": "string"
      -                      }
      -                    },
      -                    "required": [
      -                      "kind",
      -                      "field"
      -                    ],
      -                    "type": "object"
      -                  },
      -                  {
      -                    "properties": {
      -                      "key": {
      -                        "minLength": 1,
      -                        "type": "string"
      -                      },
      -                      "kind": {
      -                        "const": "custom",
      -                        "type": "string"
      -                      }
      -                    },
      -                    "required": [
      -                      "kind",
      -                      "key"
      -                    ],
      -                    "type": "object"
      -                  },
      -                  {
      -                    "properties": {
      -                      "kind": {
      -                        "const": "related",
      -                        "type": "string"
      -                      },
      -                      "path": {
      -                        "minLength": 1,
      -                        "type": "string"
      -                      }
      -                    },
      -                    "required": [
      -                      "kind",
      -                      "path"
      -                    ],
      -                    "type": "object"
      -                  }
      -                ]
      -              },
      -              "value": {}
      -            },
      -            "required": [
      -              "ref",
      -              "op"
      -            ],
      -            "type": "object"
      -          },
      -          "maxItems": 3,
      -          "type": "array"
      -        }
      -      },
      -      "required": [
      -        "fn",
      -        "alias"
      -      ],
      -      "type": "object"
      -    },
      -    "type": "array"
      -  },
      -  "board_group": {
      -    "oneOf": [
      -      {
      -        "properties": {
      -          "field": {
      -            "minLength": 1,
      -            "type": "string"
      -          },
      -          "kind": {
      -            "const": "field",
      -            "type": "string"
      -          }
      -        },
      -        "required": [
      -          "kind",
      -          "field"
      -        ],
      -        "type": "object"
      -      },
      -      {
      -        "properties": {
      -          "key": {
      -            "minLength": 1,
      -            "type": "string"
      -          },
      -          "kind": {
      -            "const": "custom",
      -            "type": "string"
      -          }
      -        },
      -        "required": [
      -          "kind",
      -          "key"
      -        ],
      -        "type": "object"
      -      },
      -      {
      -        "properties": {
      -          "kind": {
      -            "const": "related",
      -            "type": "string"
      -          },
      -          "path": {
      -            "minLength": 1,
      -            "type": "string"
      -          }
      -        },
      -        "required": [
      -          "kind",
      -          "path"
      -        ],
      -        "type": "object"
      -      }
      -    ]
      -  },
      -  "columns": {
      -    "default": [],
      -    "items": {
      -      "oneOf": [
      -        {
      -          "properties": {
      -            "field": {
      -              "minLength": 1,
      -              "type": "string"
      -            },
      -            "kind": {
      -              "const": "field",
      -              "type": "string"
      -            }
      -          },
      -          "required": [
      -            "kind",
      -            "field"
      -          ],
      -          "type": "object"
      -        },
      -        {
      -          "properties": {
      -            "key": {
      -              "minLength": 1,
      -              "type": "string"
      -            },
      -            "kind": {
      -              "const": "custom",
      -              "type": "string"
      -            }
      -          },
      -          "required": [
      -            "kind",
      -            "key"
      -          ],
      -          "type": "object"
      -        },
      -        {
      -          "properties": {
      -            "kind": {
      -              "const": "related",
      -              "type": "string"
      -            },
      -            "path": {
      -              "minLength": 1,
      -              "type": "string"
      -            }
      -          },
      -          "required": [
      -            "kind",
      -            "path"
      -          ],
      -          "type": "object"
      -        }
      -      ]
      -    },
      -    "type": "array"
      -  },
      -  "compare": {
      -    "enum": [
      -      "previous_period"
      -    ],
      -    "type": "string"
      -  },
      -  "derived": {
      -    "items": {
      -      "properties": {
      -        "alias": {
      -          "minLength": 1,
      -          "type": "string"
      -        },
      -        "denominator": {
      -          "minLength": 1,
      -          "type": "string"
      -        },
      -        "format": {
      -          "enum": [
      -            "percent",
      -            "number"
      -          ],
      -          "type": "string"
      -        },
      -        "kind": {
      -          "const": "ratio",
      -          "type": "string"
      -        },
      -        "numerator": {
      -          "minLength": 1,
      -          "type": "string"
      -        }
      -      },
      -      "required": [
      -        "kind",
      -        "numerator",
      -        "denominator",
      -        "alias"
      -      ],
      -      "type": "object"
      -    },
      -    "maxItems": 3,
      -    "type": "array"
      -  },
      -  "filter_groups": {
      -    "items": {
      -      "properties": {
      -        "filters": {
      -          "items": {
      -            "properties": {
      -              "op": {
      -                "enum": [
      -                  "eq",
      -                  "neq",
      -                  "gt",
      -                  "gte",
      -                  "lt",
      -                  "lte",
      -                  "contains",
      -                  "starts_with",
      -                  "in",
      -                  "not_in",
      -                  "has_any",
      -                  "in_period",
      -                  "is_null",
      -                  "is_not_null"
      -                ],
      -                "type": "string"
      -              },
      -              "ref": {
      -                "oneOf": [
      -                  {
      -                    "properties": {
      -                      "field": {
      -                        "minLength": 1,
      -                        "type": "string"
      -                      },
      -                      "kind": {
      -                        "const": "field",
      -                        "type": "string"
      -                      }
      -                    },
      -                    "required": [
      -                      "kind",
      -                      "field"
      -                    ],
      -                    "type": "object"
      -                  },
      -                  {
      -                    "properties": {
      -                      "key": {
      -                        "minLength": 1,
      -                        "type": "string"
      -                      },
      -                      "kind": {
      -                        "const": "custom",
      -                        "type": "string"
      -                      }
      -                    },
      -                    "required": [
      -                      "kind",
      -                      "key"
      -                    ],
      -                    "type": "object"
      -                  },
      -                  {
      -                    "properties": {
      -                      "kind": {
      -                        "const": "related",
      -                        "type": "string"
      -                      },
      -                      "path": {
      -                        "minLength": 1,
      -                        "type": "string"
      -                      }
      -                    },
      -                    "required": [
      -                      "kind",
      -                      "path"
      -                    ],
      -                    "type": "object"
      -                  }
      -                ]
      -              },
      -              "value": {}
      -            },
      -            "required": [
      -              "ref",
      -              "op"
      -            ],
      -            "type": "object"
      -          },
      -          "maxItems": 6,
      -          "minItems": 1,
      -          "type": "array"
      -        },
      -        "mode": {
      -          "enum": [
      -            "any",
      -            "none"
      -          ],
      -          "type": "string"
      -        }
      -      },
      -      "required": [
      -        "mode",
      -        "filters"
      -      ],
      -      "type": "object"
      -    },
      -    "maxItems": 4,
      -    "type": "array"
      -  },
      -  "filters": {
      -    "default": [],
      -    "items": {
      -      "properties": {
      -        "op": {
      -          "enum": [
      -            "eq",
      -            "neq",
      -            "gt",
      -            "gte",
      -            "lt",
      -            "lte",
      -            "contains",
      -            "starts_with",
      -            "in",
      -            "not_in",
      -            "has_any",
      -            "in_period",
      -            "is_null",
      -            "is_not_null"
      -          ],
      -          "type": "string"
      -        },
      -        "ref": {
      -          "oneOf": [
      -            {
      -              "properties": {
      -                "field": {
      -                  "minLength": 1,
      -                  "type": "string"
      -                },
      -                "kind": {
      -                  "const": "field",
      -                  "type": "string"
      -                }
      -              },
      -              "required": [
      -                "kind",
      -                "field"
      -              ],
      -              "type": "object"
      -            },
      -            {
      -              "properties": {
      -                "key": {
      -                  "minLength": 1,
      -                  "type": "string"
      -                },
      -                "kind": {
      -                  "const": "custom",
      -                  "type": "string"
      -                }
      -              },
      -              "required": [
      -                "kind",
      -                "key"
      -              ],
      -              "type": "object"
      -            },
      -            {
      -              "properties": {
      -                "kind": {
      -                  "const": "related",
      -                  "type": "string"
      -                },
      -                "path": {
      -                  "minLength": 1,
      -                  "type": "string"
      -                }
      -              },
      -              "required": [
      -                "kind",
      -                "path"
      -              ],
      -              "type": "object"
      -            }
      -          ]
      -        },
      -        "value": {}
      -      },
      -      "required": [
      -        "ref",
      -        "op"
      -      ],
      -      "type": "object"
      -    },
      -    "type": "array"
      -  },
      -  "group_by": {
      -    "anyOf": [
      -      {
      -        "properties": {
      -          "bucket": {
      -            "enum": [
      -              "day",
      -              "week",
      -              "month",
      -              "quarter",
      -              "year"
      -            ],
      -            "type": "string"
      -          },
      -          "ref": {
      -            "oneOf": [
      -              {
      -                "properties": {
      -                  "field": {
      -                    "minLength": 1,
      -                    "type": "string"
      -                  },
      -                  "kind": {
      -                    "const": "field",
      -                    "type": "string"
      -                  }
      -                },
      -                "required": [
      -                  "kind",
      -                  "field"
      -                ],
      -                "type": "object"
      -              },
      -              {
      -                "properties": {
      -                  "key": {
      -                    "minLength": 1,
      -                    "type": "string"
      -                  },
      -                  "kind": {
      -                    "const": "custom",
      -                    "type": "string"
      -                  }
      -                },
      -                "required": [
      -                  "kind",
      -                  "key"
      -                ],
      -                "type": "object"
      -              },
      -              {
      -                "properties": {
      -                  "kind": {
      -                    "const": "related",
      -                    "type": "string"
      -                  },
      -                  "path": {
      -                    "minLength": 1,
      -                    "type": "string"
      -                  }
      -                },
      -                "required": [
      -                  "kind",
      -                  "path"
      -                ],
      -                "type": "object"
      -              }
      -            ]
      -          }
      -        },
      -        "required": [
      -          "ref"
      -        ],
      -        "type": "object"
      -      },
      -      {
      -        "type": "null"
      -      }
      -    ]
      -  },
      -  "group_by_secondary": {
      -    "anyOf": [
      -      {
      -        "properties": {
      -          "bucket": {
      -            "enum": [
      -              "day",
      -              "week",
      -              "month",
      -              "quarter",
      -              "year"
      -            ],
      -            "type": "string"
      -          },
      -          "ref": {
      -            "oneOf": [
      -              {
      -                "properties": {
      -                  "field": {
      -                    "minLength": 1,
      -                    "type": "string"
      -                  },
      -                  "kind": {
      -                    "const": "field",
      -                    "type": "string"
      -                  }
      -                },
      -                "required": [
      -                  "kind",
      -                  "field"
      -                ],
      -                "type": "object"
      -              },
      -              {
      -                "properties": {
      -                  "key": {
      -                    "minLength": 1,
      -                    "type": "string"
      -                  },
      -                  "kind": {
      -                    "const": "custom",
      -                    "type": "string"
      -                  }
      -                },
      -                "required": [
      -                  "kind",
      -                  "key"
      -                ],
      -                "type": "object"
      -              },
      -              {
      -                "properties": {
      -                  "kind": {
      -                    "const": "related",
      -                    "type": "string"
      -                  },
      -                  "path": {
      -                    "minLength": 1,
      -                    "type": "string"
      -                  }
      -                },
      -                "required": [
      -                  "kind",
      -                  "path"
      -                ],
      -                "type": "object"
      -              }
      -            ]
      -          }
      -        },
      -        "required": [
      -          "ref"
      -        ],
      -        "type": "object"
      -      },
      -      {
      -        "type": "null"
      -      }
      -    ]
      -  },
      -  "limit": {
      -    "default": 1000,
      -    "exclusiveMinimum": 0,
      -    "maximum": 9007199254740991,
      -    "type": "integer"
      -  },
      -  "object": {
      -    "minLength": 1,
      -    "type": "string"
      -  },
      -  "related_filters": {
      -    "items": {
      -      "properties": {
      -        "filters": {
      -          "default": [],
      -          "items": {
      -            "properties": {
      -              "op": {
      -                "enum": [
      -                  "eq",
      -                  "neq",
      -                  "gt",
      -                  "gte",
      -                  "lt",
      -                  "lte",
      -                  "contains",
      -                  "starts_with",
      -                  "in",
      -                  "not_in",
      -                  "has_any",
      -                  "in_period",
      -                  "is_null",
      -                  "is_not_null"
      -                ],
      -                "type": "string"
      -              },
      -              "ref": {
      -                "oneOf": [
      -                  {
      -                    "properties": {
      -                      "field": {
      -                        "minLength": 1,
      -                        "type": "string"
      -                      },
      -                      "kind": {
      -                        "const": "field",
      -                        "type": "string"
      -                      }
      -                    },
      -                    "required": [
      -                      "kind",
      -                      "field"
      -                    ],
      -                    "type": "object"
      -                  },
      -                  {
      -                    "properties": {
      -                      "key": {
      -                        "minLength": 1,
      -                        "type": "string"
      -                      },
      -                      "kind": {
      -                        "const": "custom",
      -                        "type": "string"
      -                      }
      -                    },
      -                    "required": [
      -                      "kind",
      -                      "key"
      -                    ],
      -                    "type": "object"
      -                  },
      -                  {
      -                    "properties": {
      -                      "kind": {
      -                        "const": "related",
      -                        "type": "string"
      -                      },
      -                      "path": {
      -                        "minLength": 1,
      -                        "type": "string"
      -                      }
      -                    },
      -                    "required": [
      -                      "kind",
      -                      "path"
      -                    ],
      -                    "type": "object"
      -                  }
      -                ]
      -              },
      -              "value": {}
      -            },
      -            "required": [
      -              "ref",
      -              "op"
      -            ],
      -            "type": "object"
      -          },
      -          "maxItems": 5,
      -          "type": "array"
      -        },
      -        "mode": {
      -          "enum": [
      -            "with",
      -            "without"
      -          ],
      -          "type": "string"
      -        },
      -        "related": {
      -          "minLength": 1,
      -          "type": "string"
      -        }
      -      },
      -      "required": [
      -        "related",
      -        "mode"
      -      ],
      -      "type": "object"
      -    },
      -    "maxItems": 3,
      -    "type": "array"
      -  },
      -  "show_share": {
      -    "type": "boolean"
      -  },
      -  "sort": {
      -    "anyOf": [
      -      {
      -        "properties": {
      -          "dir": {
      -            "enum": [
      -              "asc",
      -              "desc"
      -            ],
      -            "type": "string"
      -          },
      -          "ref": {
      -            "minLength": 1,
      -            "type": "string"
      -          }
      -        },
      -        "required": [
      -          "ref",
      -          "dir"
      -        ],
      -        "type": "object"
      -      },
      -      {
      -        "type": "null"
      -      }
      -    ]
      -  },
      -  "version": {
      -    "const": 1,
      -    "type": "number"
      -  },
      -  "viz": {
      -    "enum": [
      -      "table",
      -      "bar",
      -      "stat",
      -      "trend",
      -      "donut",
      -      "board",
      -      "matrix",
      -      "funnel",
      -      "column",
      -      "area"
      -    ],
      -    "type": "string"
      -  }
      -}
    • removedInput schema / properties / definition / required
      Removed value: -[
      -  "version",
      -  "object"
      -]
    • removedInput schema / properties / definition / type
      Removed value: -"object"
  5. First observed

TDQS

A4.4/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Goes well past the annotations: discloses that exports traverse a single audited egress path and that each export writes a report_runs row plus an audit_log report.export event, and states the return payload (CSV text + row count + filename). It also discloses refusal behavior (dashboard or segment id rejected) rather than leaving it to error discovery.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the operation and return shape, then parameters, then when-to-use. It is slightly repetitive: the 'When to use' paragraph restates 'one saved analysis or an inline ReportSpec as CSV' and the dashboard caveat already given in the opening paragraph, costing a little density.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists and the description still names the returned fields; the precedence between report_id and definition, the dashboard exclusion, and the audit side-effect are all covered. For a two-parameter export tool, nothing an agent needs to call it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so both parameters are already documented in the schema, including the report_id-wins precedence rule and the 'dashboard or segment id is refused' constraint. The description adds only a restatement ('Pass report_id for a saved analysis or an inline ReportSpec'), so the baseline of 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a precise verb+resource+format: 'Export one saved analysis's results as CSV,' and adds scope ('through the single audited egress path'). The dashboard caveat ('a dashboard is not one CSV') further sharpens what the tool does and does not cover, so it is distinguishable from report-reading/listing siblings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Has an explicit 'When to use' section plus a when-not condition (a dashboard needs a panel chosen first; it is not exported as one table). It stops short of naming alternative siblings such as run_report, show_report, or schedule_report, so the agent must infer the boundary from the schema's cross-reference instead.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources