Skip to main content
Glama

refactor

Replace duplicate PySpark patterns with utility functions, extract common code, and generate optimized data pipeline structures from sources and processing requirements.

Instructions

Deprecated. Prefer review. Still registered this minor version.

Refactor PySpark code and generate pipeline structures.

Modes:

patterns Refactor code by replacing duplicate patterns with utility function calls. Parameters: original_code (required), code_samples (required)

utilities Extract common utility functions from code patterns. Parameters: code_samples (required), patterns

pipeline Generate optimized PySpark data pipeline code or project structure. Parameters (pipeline): data_sources (required list), processing_requirements (required), target_format, include_monitoring Parameters (project): sql_content, workspace_name, workspace_path, output_dir, include_glue_template, dialect, include_batch_processing, include_visualization

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeYes
dialectNo
patternsNo
output_dirNo
sql_contentNo
code_samplesNo
data_sourcesNo
original_codeNo
target_formatNodelta
workspace_nameNo
workspace_pathNo
include_monitoringNo
include_glue_templateNo
include_visualizationNo
processing_requirementsNo
include_batch_processingNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

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

  1. First observedv0.0.4

TDQS

A4.6/5.0
Behavior4/5

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

With no annotations provided, the description carries the burden of behavioral disclosure, and it does so well by explaining what each mode does: replacing duplicate patterns, extracting utilities, and generating pipeline or project code. It also discloses the deprecation status and that the tool remains registered. It does not mention side effects or return behavior, but the described behaviors are sufficiently concrete for an agent to anticipate what will happen.

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 front-loaded with the most important decision-related information: deprecation and the preferred alternative. It then uses a clear mode-based structure with bullet-style parameter lists. Despite its length, the size is justified by 16 parameters and three modes, and every section contributes actionable guidance.

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 high complexity—16 parameters, three modes, no annotations, and zero schema description coverage—the description is quite complete: it identifies all modes, their purposes, required parameters, and the preferred replacement. It does not explicitly restate the 'mode' parameter as a field in the schema, but the mode names are clearly used as the expected values. Since an output schema exists, the lack of return-format details is acceptable.

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?

Schema description coverage is 0%, so the description must compensate, and it does by mapping parameters to specific modes and marking which are required. It adds meaning beyond the bare JSON schema by grouping parameters under 'patterns,' 'utilities,' 'pipeline,' and 'project' contexts, which the schema alone does not convey. Some parameter semantics remain implicit from names, but the mode-based organization materially improves parameter understanding.

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 opens with a clear deprecation notice and names the preferred alternative, review, which immediately distinguishes this tool from its siblings. It then states the core action ('Refactor PySpark code and generate pipeline structures') and enumerates three specific modes with distinct behaviors, so an agent can tell what the tool does and how it differs from related tools.

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?

The description explicitly says 'Deprecated. Prefer review. Still registered this minor version,' giving an unambiguous when-not-to-use instruction and naming the alternative. Within the modes, it lists mode-specific required parameters, which further guides invocation by telling the agent which parameters to supply for each mode.

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