Skip to main content
Glama

Generate a Chart from Data

meta_generate_chart
Idempotent

Generate PNG chart images from data for visual reports. Use to create bar, line, pie, and other chart types from Meta insights data.

Instructions

Generates a chart image (PNG) from provided data. Uses QuickChart (Chart.js) to render.

Perfect for creating visual reports from Meta insights data. The chart is saved as a PNG file that can be inserted into Word docs, presentations, or shared directly.

Args:

  • chart_type (string): 'bar', 'line', 'pie', 'doughnut', 'radar', 'polarArea', 'horizontalBar'

  • title (string): Chart title

  • labels (string[]): X-axis labels or pie slice labels

  • datasets (array): One or more datasets, each with:

    • label (string): Dataset name (e.g., "Impressions")

    • data (number[]): Data values matching labels

    • color (string, optional): CSS color (e.g., "#1877F2", "rgba(24,119,242,0.5)")

  • width (number): Image width in pixels (default: 800)

  • height (number): Image height in pixels (default: 400)

  • output_path (string, optional): Save PNG to this path. If omitted, returns the chart URL.

  • stacked (boolean, optional): Stack bars/lines (default: false)

  • show_values (boolean, optional): Display data values on the chart (default: false)

Returns: Chart URL or file path. The URL can be opened in a browser or fetched as a PNG.

Example datasets for ad performance: labels: ["Mon","Tue","Wed","Thu","Fri"] datasets: [ { label: "Impressions", data: [1200,1800,1500,2100,1900], color: "#1877F2" }, { label: "Clicks", data: [45,62,51,78,65], color: "#42B72A" } ]

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chart_typeNobar
titleYes
labelsYes
datasetsYes
widthNo
heightNo
output_pathNoSave PNG to this file path
stackedNo
show_valuesNo
response_formatNoOutput format: 'markdown' for human-readable or 'json' for machine-readablemarkdown
Behavior4/5

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

Annotations indicate idempotent and non-destructive behavior. The description adds transparency by explaining the output (chart URL or file path), that the chart is saved as PNG, and that it can be inserted into docs or presentations. It does not mention the external QuickChart dependency but overall is sufficient.

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 a clear first sentence, a use-case paragraph, parameter list, return info, and example. It is informative but slightly lengthy; minor trimming could improve conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Considering the tool's complexity (10 parameters, 3 required) and lack of output schema, the description covers all parameters, defaults, return values, and provides a concrete example. It is complete enough for an AI agent to use 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?

Schema description coverage is low (20%), but the description provides a detailed 'Args:' section explaining each parameter, defaults, and the structure of datasets. It includes an example with ad performance data, greatly supplementing the schema.

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 generates a chart image (PNG) from data using QuickChart/Chart.js, and distinguishes it from the sibling 'meta_generate_comparison_chart' by focusing on standard charts. The use case for Meta insights reports is explicitly mentioned.

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 an implied usage 'Perfect for creating visual reports from Meta insights data' but does not explicitly state when to use this tool vs alternatives like 'meta_generate_comparison_chart'. No exclusion criteria or when-not-to-use guidance is given.

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/oliverames/meta-mcp-server'

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