Skip to main content
Glama

optimize

Analyze PySpark code to optimize performance, recommend join strategies, and suggest partitioning for efficient data processing.

Instructions

Optimize PySpark code and recommend performance improvements.

Modes:

code Apply optimizations to PySpark code. Parameters: code (required), optimization_level

joins Recommend join strategies based on estimated table sizes. Parameters: pyspark_code (required), table_info

partitioning Suggest optimal partitioning strategies. Parameters: pyspark_code (required), table_info

comprehensive Generate comprehensive optimization recommendations + performance estimates. Parameters: pyspark_code (required), table_info

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeNo
modeYes
table_infoNo
pyspark_codeNo
optimization_levelNostandard

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior3/5

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

With no annotations, the description carries the full burden. It discloses that the tool applies optimizations, recommends join strategies, and suggests partitioning, but lacks detail on side effects (e.g., whether code is modified or just suggestions), permissions, or output format. The output schema may cover return values, but behavioral traits remain incomplete.

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-structured with clear mode headings and parameter lists. It is mostly concise but repeats 'Parameters:' for each mode, which is slightly redundant. Still, it is easy to scan and front-loads the key functionality.

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 complexity (multiple modes, 5 parameters) and the presence of an output schema, the description covers the essential functionality and parameter usage adequately. It could be enhanced by mentioning prerequisites or limitations, but overall it is sufficient for an agent to decide when to use this tool.

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. It does so by associating each mode with its specific parameters (e.g., 'code' mode uses 'code' and 'optimization_level'), adding meaning beyond the generic schema. However, it does not describe value constraints (e.g., allowed values for 'optimization_level').

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 optimizes PySpark code and recommends performance improvements, with distinct modes (code, joins, partitioning, comprehensive) that differentiate it from siblings like 'analyze' or 'refactor'. Each mode has a specific verb and resource.

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 usage context for each mode, including which parameters are required. However, it does not explicitly state when not to use this tool or compare it to sibling tools like 'analyze' or 'review', leaving some ambiguity.

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