Skip to main content
Glama

execute_polars_sql

Run SQL queries on local CSV or Parquet files using Polars to analyze large datasets without uploading the full data.

Instructions

Reads the data from the given file locations. Note that file_locations can be a list of multiple files. However, all files must have the same schema and the same columns. Executes the given polars sql query and returns the result. Note that the polars sql query must use the table name as self to refer to the source data.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_locationsYes
queryYes The polars sql query to be executed. polars sql query must use the table name as `self` to refer to the source data. Supported functions are: Aggregate: - Avg - Count - First - Last - Max - Median - Min - Sum - Quantile_count - Quantile_disc - Stddev - Sum - Variance Array: - Array_agg - Array_contains - Array_get - Array_length - Array_lower - Array_mean - Array_reverse - Array_sum - Array_to_string - Array_unique - Array_upper - Unnest Bitwise: - Bit_and - Bit_count - Bit_or - Bit_xor Conditional: - Coalesce - Greatest - If - Ifnull - Least - Nullif Mathematical: - Abs - Cbrt - Ceil - Div - Exp - Floor - Ln - Log2 - Log10 - Mod - Pi - Pow - Round - Sign - Sqrt String: - Bit_length - Concat - Concat_ws - Date - Ends_with - Initcap - Left - Length - Lower - Ltrim - Normalize - Octet_length - Regexp_like - Replace - Reverse - Right - Rtrim - Starts_with - Strpos - Strptime - Substr - Timestamp - Upper Temporal: - Date_part - Extract - Strftime Type: - Cast - Try_cast Trigonometric: - Acos - Acosd - Asin - Asind - Atan - Atand - Atan2 - Atan2d - Cot - Cotd - Cos - Cosd - Degrees - Radians - Sin - Sind - Tan - Tand
file_typeNoThe type of the file to be read. Supported types are csv and parquetcsv
Behavior2/5

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

No annotations are provided, so the description bears full responsibility for behavioral disclosure. It mentions reading files and executing SQL, but does not detail side effects (likely none), performance implications, error handling (e.g., incompatible schemas), or return value structure. This is insufficient for a data-execution tool.

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 three sentences long, immediately stating the core purpose and key constraints. No redundant or extraneous information, and the structure is clear and front-loaded.

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

Completeness2/5

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

The tool is moderately complex (file reading, SQL execution), yet the description omits details on return format, error behavior, supported file paths, and limitations. Without an output schema, the agent is left without enough information to fully understand the tool's behavior.

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 description coverage is 67%, and the description adds value for 'file_locations' (must have same schema) and 'query' (must use 'self'). However, the extensive list of supported functions is already in the input schema for 'query', so the description only marginally supplements with constraint context. Baseline of 3 is appropriate.

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 reads data from file locations and executes a Polars SQL query, returning the result. It specifies the action (reads, executes), resource (file data, SQL query), and output. This differentiates it from sibling tools (get_files_list, get_schema) which focus on listing files and schemas respectively.

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

Usage Guidelines3/5

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

The description notes key constraints: all files must share the same schema and columns, and the SQL query must refer to the source data as 'self'. However, it does not explicitly state when to use this tool over alternatives or when not to use it, leaving the agent to infer from 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/unravel-team/mcp-analyst'

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