Skip to main content
Glama

plot_heatmap

Generate publication-quality heatmaps to visualize matrix data like correlation matrices, confusion matrices, or any 2D datasets with customizable annotations and styling.

Instructions

Create a heatmap for visualizing matrix data.

This tool generates a heatmap with optional annotations, ideal for correlation matrices, confusion matrices, or any 2D data.

Args: data: For direct input, 2D list (matrix). For file input, column name. data_input: Optional. {"file_path": "path/to/file.csv"} or {"data": {...}} x_labels: Optional labels for x-axis (columns) y_labels: Optional labels for y-axis (rows) annotate: If True, show values in each cell style: Optional. {"title": "...", "xlabel": "...", "ylabel": "...", "colormap": "viridis"} output: Optional. {"format": "png/pdf/svg", "width": 15, "height": 10, "dpi": 300}

Returns: PIL Image object or bytes containing the plot

Examples: Correlation matrix: >>> plot_heatmap( ... data=[[1.0, 0.8, 0.3], [0.8, 1.0, 0.5], [0.3, 0.5, 1.0]], ... x_labels=["A", "B", "C"], ... y_labels=["A", "B", "C"], ... annotate=True, ... style={"title": "Correlation Matrix", "colormap": "RdBu"} ... )

From file:
>>> plot_heatmap(
...     data="matrix",
...     data_input={"file_path": "data_matrix.csv"},
...     style={"colormap": "plasma"}
... )

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYes
data_inputNo
x_labelsNo
y_labelsNo
annotateNo
styleNo
outputNo
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses that the tool 'generates a heatmap' and returns 'PIL Image object or bytes containing the plot,' which covers basic behavior. However, it doesn't mention performance characteristics, error conditions, or side effects like file creation from output parameters.

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 purpose statement, usage context, parameter explanations, return value, and examples. While comprehensive, it's appropriately sized for a 7-parameter tool with complex options. Every section adds value, though some sentences could be more concise.

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 7 parameters with 0% schema coverage and no output schema, the description does an excellent job explaining parameters and return values. It provides concrete examples showing both direct data and file input scenarios. The main gap is lack of behavioral details like error handling or performance limits.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description fully compensates by explaining all 7 parameters in detail. Each parameter gets clear semantic explanation beyond type information: 'data' distinguishes between direct input and file input, 'annotate' explains 'show values in each cell,' and style/output objects get specific field explanations.

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's purpose: 'Create a heatmap for visualizing matrix data.' It specifies the verb ('create'), resource ('heatmap'), and scope ('matrix data'), and distinguishes from siblings by focusing on heatmaps rather than other plot types like bar or scatter plots.

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 context for when to use this tool: 'ideal for correlation matrices, confusion matrices, or any 2D data.' It doesn't explicitly state when not to use it or name specific alternatives among siblings, but the examples illustrate appropriate use cases.

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/nishide-dev/ml-research-mcp'

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