Skip to main content
Glama

convert

Convert SQL queries to PySpark code, handle batch file and directory conversions, and extract SQL from PDFs for PySpark processing.

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, style (production | notebook), target (spark | glue)

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
styleNoproduction
targetNospark
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

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed2 schema fields changedv0.1.0
    • addedInput schema / properties / style
      Added value: +{
      +  "default": "production",
      +  "type": "string"
      +}
    • addedInput schema / properties / target
      Added value: +{
      +  "default": "spark",
      +  "type": "string"
      +}
  2. First observedv0.0.4

TDQS

B3.3/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It explains what each mode does at a high level, but it does not disclose side effects such as creating files, overwriting, directory scanning behavior, error conditions, or performance characteristics.

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-organized with a clear opening purpose and structured mode sections. It is longer than average but the length is justified by the four distinct modes and their parameter lists.

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 (14 parameters, four modes), the description does a solid job of laying out mode-specific required parameters and basic semantics. It is not fully complete because several parameter meanings and behavioral outcomes are left implicit, but it is sufficient for basic invocation.

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 0%, so the description must compensate. It lists mode-specific parameters and some allowed values (style: production|notebook, target: spark|glue), but it does not explain the meaning of parameters like table_info, optimization_level, include_glue_template, output_dir, or recursive, leaving many parameters underspecified.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool converts SQL to PySpark code and supports batch file/directory processing and PDF extraction. It distinguishes itself by specific action and resources, though it does not explicitly name 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 Guidelines3/5

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

The description defines four distinct modes with their required parameters, which gives an agent enough context to select a mode. However, it does not explicitly state when to use this tool over siblings like analyze, optimize, or refactor, nor does it offer exclusion guidance.

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

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