Skip to main content
Glama

analyze

Analyze SQL or PySpark code to understand context, data flow, and discover optimization opportunities.

Instructions

Analyze SQL or PySpark code for context, data flow, or optimization opportunities.

Modes:

sql_context Analyze SQL context (schemas, tables, dialect, complexity). Parameters: sql_content or selected_text

data_flow Analyze data flow patterns in PySpark code. Parameters: pyspark_code (required), table_info

codebase Analyze a PySpark codebase directory for patterns and issues. Parameters: directory_path (required), include_optimization_suggestions, scan_depth

workspace Full workspace analysis including project structure. Parameters: sql_content or workspace_path, include_project_structure, workspace_name

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeYes
scan_depthNo
table_infoNo
sql_contentNo
pyspark_codeNo
selected_textNo
directory_pathNo
workspace_nameNo
workspace_pathNo
include_project_structureNo
include_optimization_suggestionsNo

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 provided, the description bears full responsibility for behavioral disclosure. It explains that the tool analyzes code but does not state whether it is read-only, destructive, or requires authentication. No side effects or limitations are mentioned.

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 a clear opening line and bullet-pointed modes. It is front-loaded with the general purpose. Some redundancy exists (repeating 'Parameters:' for each mode), but overall it is reasonably concise.

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 (multi-mode, 11 parameters) and lack of annotations, the description is incomplete. It does not describe return values despite an output schema existing, and it omits details for several parameters such as 'workspace_path' and 'include_project_structure'.

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. While parameters are grouped by mode, their meanings are not explained beyond names (e.g., 'sql_content', 'selected_text'). The description adds little value for understanding parameter usage or constraints.

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 analyzes SQL or PySpark code for context, data flow, or optimization opportunities. It further defines four distinct modes (sql_context, data_flow, codebase, workspace), each with a specific purpose, which distinguishes it from sibling tools like 'context' or 'optimize' that might be more focused.

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 lists modes and associated parameters but provides no guidance on when to use this tool versus alternatives like sibling tools 'context', 'optimize', or 'review'. There is no mention of prerequisites, exclusions, or decision criteria for choosing a mode.

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