Skip to main content
Glama

pca_transform

Apply PCA to numeric columns, generating principal components (PC1, PC2...) for visualization, multicollinearity reduction, or feature compression.

Instructions

PCA dimensionality reduction. Projects numeric columns onto principal components. New columns PC1, PC2, ... are added to the dataframe. Features are auto-standardized. If plot=True and n_components>=2, also stores a 2D scatter plot (viewable via save_report). Use to visualize high-dimensional data, reduce multicollinearity, or compress features. Example: pca_transform(columns=["Revenue","Weight","Pieces"], n_components=2, hue="CargoType")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hueNo
plotNo
columnsYes
df_nameNo
save_pathNo
n_componentsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/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 key behaviors: features are auto-standardized, PC columns are added, and a 2D scatter plot is stored when plot=True. This goes beyond simple operation statements, though it doesn't specify whether original columns are preserved or how save_path affects output.

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, using a short paragraph followed by a concrete example. It avoids verbose explanations, but the example adds a line that could be seen as extra; still, it earns its place by illustrating parameter usage.

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 presence of an output schema and the tool's moderate complexity, the description covers the key outcomes (new columns, plot storage) and usage scenarios. It doesn't explain return values because output schema exists, and no annotations mean it handles safety disclosure well enough.

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 explains the purpose of columns, n_components, plot, and hue via the example, but df_name and save_path are not explicitly described. The example provides practical parameter mapping, but not all parameters are covered.

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 performs PCA dimensionality reduction, projects numeric columns onto principal components, and adds PC columns to the dataframe. This specific verb+resource pairing distinguishes it from siblings like tsne_plot, which uses a different algorithm.

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 explicitly states when to use the tool: 'Use to visualize high-dimensional data, reduce multicollinearity, or compress features.' This provides clear usage context, though it does not name alternative tools or when not to use them.

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/AstyanM/mcp-data-science'

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