Skip to main content
Glama

export_query

Run arbitrary read-only SQL to export query results to a file, returning a link for retrieval. Handles complex queries like joins and custom aggregates that standard exports don't cover.

Instructions

Run arbitrary read-only SQL straight to a file; return a link, not rows.

The export escape hatch, for shapes export_series does not cover (joins against run, multi-index array columns, custom aggregates). Same contract as export_series: read the returned URL from your code execution environment rather than into context.

Runs in a READ ONLY transaction. Prefer run_query when you only need to look at a handful of rows yourself.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
carNo
sqlYes
formatNocsv

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations provided, the description carries the full behavioral burden. It discloses that the query runs in a READ ONLY transaction, that the result is a URL rather than rows, and that the URL must be fetched from the code execution environment rather than pulled into context. These are meaningful behavioral details, though it does not mention file lifetime, cleanup, or access constraints.

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

Conciseness5/5

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

The description is tight and well-structured: the main behavior is front-loaded, followed by the escape-hatch rationale, the URL-fetching contract, and the alternative tool preference. Every sentence adds distinct value with no filler.

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

Completeness3/5

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

The description covers purpose, alternatives, and key runtime behavior, and an output schema exists to document return values. However, with zero schema descriptions and no explanation of the car parameter or format options, an agent cannot fully determine how to invoke the tool correctly in all cases.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate for missing parameter explanations. It gives context for sql as arbitrary read-only SQL, but the car parameter is entirely unexplained, and format is only implied by 'straight to a file'. This leaves a required part of the contract opaque.

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?

The description opens with a specific, unambiguous statement: run arbitrary read-only SQL to a file and return a link rather than rows. It also explicitly frames the tool as an escape hatch for cases export_series does not cover, clearly distinguishing it from sibling tools.

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

Usage Guidelines5/5

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

The description gives explicit when-to-use guidance: use this tool for joins against run, multi-index array columns, and custom aggregates that export_series cannot handle. It also tells the agent to prefer run_query when only a handful of rows are needed, providing a clear alternative and exclusion.

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