Skip to main content
Glama

plot_histogram

Generate histograms to visualize data distribution and frequency patterns for analysis in machine learning research.

Instructions

Create a histogram for data distribution analysis.

This tool generates a histogram showing the frequency distribution of numerical data. Useful for understanding data spread and patterns.

Args: data: Data column name (string) if using data file, or list of values. data_input: Optional. {"file_path": "path/to/file.csv"} or {"data": {...}} bins: Number of histogram bins (default: 30) density: If True, normalize to show probability density style: Optional. {"title": "...", "xlabel": "...", "ylabel": "...", "grid": True} output: Optional. {"format": "png/pdf/svg", "width": 15, "height": 10, "dpi": 300}

Returns: PIL Image object or bytes containing the plot

Examples: Basic histogram: >>> plot_histogram(data=[1.2, 2.3, 2.5, 3.1, 3.4, 4.2, 4.5], bins=10)

Histogram from CSV with density:
>>> plot_histogram(
...     data="measurement",
...     data_input={"file_path": "measurements.csv"},
...     bins=50,
...     density=True,
...     style={"title": "Measurement Distribution"}
... )

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYes
data_inputNo
binsNo
densityNo
styleNo
outputNo
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes what the tool does (generates a histogram), the return type (PIL Image or bytes), and includes practical examples showing usage patterns. It doesn't mention performance characteristics, error conditions, or side effects, but provides substantial operational context beyond basic functionality.

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 sections (purpose, Args, Returns, Examples) and front-loaded with the core functionality. While comprehensive, some sentences could be more concise (e.g., the two-sentence purpose paragraph could be combined). The examples are detailed but necessary for understanding 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?

For a 6-parameter visualization tool with no annotations and no output schema, the description provides substantial context: clear purpose, detailed parameter explanations, return type specification, and practical examples. It doesn't explain error conditions or advanced usage scenarios, but covers the essential information needed to use the tool effectively given the complexity.

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?

Given 0% schema description coverage, the description fully compensates by providing detailed parameter documentation in the Args section. Each parameter (data, data_input, bins, density, style, output) is clearly explained with examples of valid values and usage. The description adds significant meaning beyond the bare schema, including default values, data formats, and practical usage examples.

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 histogram for data distribution analysis' and 'generates a histogram showing the frequency distribution of numerical data'. It distinguishes from siblings by specifying it's for histogram creation (vs. bar, box, scatter plots, etc.), with a specific verb ('create', 'generates') and resource ('histogram').

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: 'Useful for understanding data spread and patterns'. However, it doesn't explicitly state when not to use it or name specific alternatives among the sibling tools (e.g., plot_box for distribution comparison, plot_violin for density visualization). The examples imply usage scenarios but lack explicit guidance on tool selection.

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