Skip to main content
Glama

convert

Convert SQL to PySpark code. Handles single queries, batch files, directories, and PDF extraction for data engineering workflows.

Instructions

Convert SQL to PySpark code or process SQL files in batch.

Modes:

sql Convert a single SQL query to PySpark code. Parameters: sql_query (required), table_info, dialect, optimization_level, include_glue_template

batch_files Process multiple SQL files into PySpark. Parameters: file_paths (required list), output_dir, job_name

batch_dir Process all SQL files in a directory. Parameters: directory_path (required), output_dir, recursive, job_name

from_pdf Extract SQL from a PDF file and convert to PySpark. Parameters: pdf_path (required)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeYes
dialectNo
job_nameNo
pdf_pathNo
recursiveNo
sql_queryNo
file_pathsNo
output_dirNo
table_infoNo
directory_pathNo
optimization_levelNostandard
include_glue_templateNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior2/5

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

With no annotations, the description carries full burden for behavioral transparency. It states the tool converts SQL to PySpark but does not disclose side effects (e.g., read-only or destructive nature), permissions, or output details. The presence of an output schema mitigates some missing return info, but the description omits important behavioral traits like input validation or error handling.

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 concise and well-structured with bullet-pointed modes. It front-loads the main purpose and uses a clear hierarchical format. Every sentence adds value, though some parameter descriptions could be expanded without sacrificing conciseness.

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?

Given the tool's complexity (4 modes, 12 parameters) and lack of annotations, the description is incomplete. It explains what each mode does but fails to cover parameter constraints, expected output, error conditions, or pre-requisites. The output schema exists but the description doesn't reference it, leaving gaps for robust tool invocation.

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. It lists parameters per mode but adds minimal meaning beyond their names (e.g., 'table_info' and 'optimization_level' have no explanation of their purpose or allowed values). It does indicate which parameters are required in each mode, which is useful, but overall semantic depth is insufficient for a 12-parameter tool.

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: 'Convert SQL to PySpark code or process SQL files in batch.' The verb 'convert' and resource 'SQL to PySpark' are specific. It distinguishes from sibling tools (none of which perform conversion) and outlines four distinct modes, making its function unambiguous.

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

Usage Guidelines2/5

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

The description lacks explicit guidance on when to use this tool versus alternatives. It does not address when not to use it, nor does it compare with sibling tools. The modes are described, but no criteria are given to help an agent decide which mode to select, leaving the agent to guess.

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/AnnasMazhar/pyspark_mcp'

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