Skip to main content
Glama
BauplanLabs

Bauplan MCP Server

Official
by BauplanLabs

run_query_to_csv

Execute SQL SELECT queries on a Bauplan data catalog table and save results to a CSV file, providing the output file path.

Instructions

Execute SQL SELECT queries on a specified table in the user's Bauplan data catalog, saving results to a CSV file, using a query and table name, returning a file path. Execute SELECT queries and save results directly to CSV file.

Note: CSV format only supports scalar data types (strings, numbers, booleans). Queries returning complex types (arrays, lists, nested objects) will fail. For complex data, use run_query tool instead or modify SQL to flatten/convert data.

Args: path: Output CSV file path where results will be saved. query: SQL query to execute (DuckDB SQL syntax). ref: Branch/reference to query against (optional). namespace: Namespace to use (optional). client_timeout: Timeout in seconds (defaults to 120).

Returns: QueryToCSVResult: Object indicating success/failure with execution details

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
queryYes
refNo
namespaceNo
client_timeoutNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
queryYes
refYes
namespaceYes
successYes
messageYes
Behavior4/5

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

With no annotations, the description shoulders the burden. It discloses the limitation that only scalar types are supported and that complex types cause failure. It doesn't mention potential side effects (e.g., file overwrite) but given it's a SELECT query, destructive behavior is unlikely.

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?

The description is well-structured: a brief summary followed by a note about type limitations and a parameter list. It is concise without unnecessary fluff.

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

Completeness4/5

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

Given the output schema exists (QueryToCSVResult), the description covers inputs, constraints, and return type sufficiently. It could mention the output schema contents, but the detail of 'success/failure' is adequate.

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

Parameters4/5

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

All five parameters are described in plain language, including their purpose (path as output file path, query as DuckDB SQL, etc.), types, and defaults. Since schema coverage is 0%, the description compensates well.

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 clearly states the tool executes SQL SELECT queries and saves results to CSV. It specifies the resource (user's Bauplan data catalog table), verb (execute), and distinguishes from sibling 'run_query' by noting its limitation to scalar types.

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?

It explicitly advises against using when queries return complex types, and directs to the alternative 'run_query' tool. It also mentions optional parameters and defaults, providing clear when-to-use context.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/BauplanLabs/bauplan-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server