Skip to main content
Glama

hue_run_query_to_csv

Execute SQL queries and export results directly to CSV files for data analysis or reporting. This tool runs queries using Hive, SparkSQL, or Impala and saves the output as CSV.

Instructions

Execute a SQL query and save results directly to a CSV file.

This is a convenience method that combines query execution with CSV export.
Ideal for exporting large result sets to files.

Args:
    statement: The SQL statement to execute
    filename: Output CSV filename (default: 'results.csv')
    dialect: SQL dialect - 'hive', 'sparksql', or 'impala' (default: 'hive')
    batch_size: Number of rows to fetch per batch (default: 1000)

Returns:
    OperationResult indicating success and the output filename

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
statementYes
filenameNoresults.csv
dialectNohive
batch_sizeNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNoRelevant path for the operation
messageYesStatus message
successYesWhether the operation succeeded
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It describes the tool's core behavior (executing SQL and saving to CSV) and mentions it's for 'large result sets' with batching, but lacks details on permissions, error handling, rate limits, or file system implications. It adds some context but doesn't fully compensate for the absence of annotations.

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 well-structured and appropriately sized. It starts with a clear purpose statement, adds context in the second sentence, and efficiently documents parameters and returns in labeled sections. Every sentence adds value without redundancy, making it easy to parse.

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 tool's complexity (4 parameters, no annotations, but with an output schema), the description is mostly complete. It explains parameters thoroughly and mentions the return type ('OperationResult'), but since there's an output schema, it doesn't need to detail return values. However, it could better address behavioral aspects like error cases or performance implications.

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

Parameters5/5

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

The description adds significant meaning beyond the input schema, which has 0% description coverage. It explains each parameter's purpose: 'statement' as the SQL to execute, 'filename' as the output CSV file, 'dialect' with allowed values ('hive', 'sparksql', or 'impala'), and 'batch_size' as rows per batch. This fully compensates for the schema's lack of descriptions.

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's purpose with specific verbs ('execute a SQL query and save results directly to a CSV file') and distinguishes it from siblings like 'hue_execute_query' (which doesn't export) and 'hue_export_and_download' (which may have different functionality). The phrase 'convenience method that combines query execution with CSV export' further clarifies its unique role.

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?

The description provides clear context for when to use this tool ('ideal for exporting large result sets to files'), but it doesn't explicitly state when not to use it or name specific alternatives among the sibling tools. It implies usage for CSV export scenarios without detailed exclusions or comparisons.

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/SpanishST/hueclientrest-mpc'

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