Skip to main content
Glama

plot_line

Generate line plots from CSV, JSON, or direct data inputs to visualize trends and relationships in research data.

Instructions

Create a line plot from data.

This tool generates a line plot using UltraPlot/Matplotlib. You can provide data either as a file path (CSV/JSON) or directly as lists.

Args: x: X-axis data. Column name (string) if using data file, or list of values. y: Y-axis data. Column name (string) if using data file, or list of values. data_input: Optional. {"file_path": "path/to/file.csv"} or {"data": {...}} style: Optional. {"title": "...", "xlabel": "...", "ylabel": "...", "colormap": "...", "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 line plot with direct data: >>> plot_line(x=[1, 2, 3], y=[1, 4, 9])

Line plot from CSV file:
>>> plot_line(
...     x="time",
...     y="temperature",
...     data_input={"file_path": "experiment.csv"},
...     style={"title": "Temperature Over Time", "xlabel": "Time (s)"}
... )

High-resolution PDF output:
>>> plot_line(
...     x=[1, 2, 3],
...     y=[1, 4, 9],
...     output={"format": "pdf", "width": 20, "height": 15}
... )

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xYes
yYes
data_inputNo
styleNo
outputNo
Behavior4/5

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

With no annotations provided, the description carries full burden and does well by explaining: 1) what gets created (a line plot), 2) the two data input methods (file path or direct lists), 3) the return type (PIL Image object or bytes), and 4) the optional styling and output configuration. It doesn't mention performance characteristics or error conditions, but covers the essential behavioral aspects for a plotting tool.

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-loads the core functionality. The examples are comprehensive but could be slightly more concise. Every sentence adds value, though the formatting with triple quotes and indentation in the examples adds some visual complexity.

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 5-parameter tool with no annotations and no output schema, the description provides excellent coverage: purpose, parameter semantics, return values, and multiple usage examples. It doesn't cover error cases or performance limits, but given the tool's complexity level, it provides sufficient context for an agent to use it correctly.

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 providing detailed parameter explanations in the Args section and examples. It clarifies the dual nature of x/y parameters (column names or lists), explains the structure of data_input, style, and output objects, and provides concrete examples showing how to use each parameter effectively.

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 line plot from data' with specific implementation details ('using UltraPlot/Matplotlib'). It distinguishes itself from sibling tools (plot_bar, plot_scatter, etc.) by specifying it's for line plots specifically, not other plot types.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides implied usage guidance through examples showing different scenarios (basic plot, CSV file plot, PDF output). However, it lacks explicit guidance on when to choose this tool over sibling plotting tools (e.g., when to use plot_line vs plot_scatter vs plot_bar). The examples help but don't provide comparative decision criteria.

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