Skip to main content
Glama

plot_bar

Create bar plots to compare categorical data values, generating publication-quality visualizations for research analysis.

Instructions

Create a bar plot for categorical data comparison.

This tool generates vertical or horizontal bar plots, ideal for comparing values across different categories.

Args: x: Category labels. Column name (string) if using data file, or list of strings. y: Values for each category. Column name or list of numbers. data_input: Optional. {"file_path": "path/to/file.csv"} or {"data": {...}} orientation: "vertical" or "horizontal" bars (default: "vertical") 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: Vertical bar plot: >>> plot_bar( ... x=["A", "B", "C"], ... y=[10, 25, 15], ... style={"title": "Category Comparison"} ... )

Horizontal bar plot from file:
>>> plot_bar(
...     x="product",
...     y="sales",
...     data_input={"file_path": "sales.csv"},
...     orientation="horizontal"
... )

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xYes
yYes
data_inputNo
orientationNovertical
styleNo
outputNo
Behavior3/5

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

With no annotations provided, the description carries full burden. It discloses the tool generates plots and returns 'PIL Image object or bytes,' which covers output behavior. However, it doesn't mention performance characteristics, error conditions, or side effects like file creation. The examples help but don't fully compensate for missing behavioral details.

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, parameter documentation, return specification, and examples. While comprehensive, some sentences could be more concise (e.g., the orientation description repeats 'vertical or horizontal'). Overall, it's appropriately sized for a 6-parameter tool with complex options.

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 tool's complexity (6 parameters, no annotations, no output schema), the description provides substantial context: purpose, all parameter semantics, return type, and examples. It lacks some behavioral details like error handling or performance limits, but covers the essential usage context adequately for a plotting tool.

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 must fully document parameters. It provides detailed semantics for all 6 parameters, explaining what each represents (e.g., 'x: Category labels'), data formats, optional status, defaults, and even complex nested structures like data_input and style objects. This completely compensates for the schema gap.

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 bar plot for categorical data comparison.' It specifies the verb ('create'), resource ('bar plot'), and scope ('categorical data comparison'), distinguishing it from sibling tools like plot_line or plot_scatter that serve different visualization purposes.

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 about when to use this tool: 'ideal for comparing values across different categories.' It doesn't explicitly state when NOT to use it or name specific alternatives among siblings, but the categorical comparison focus gives strong implicit guidance versus continuous data plots like plot_line.

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