Skip to main content
Glama

Generate a Chart from Data

meta_generate_chart
Idempotent

Turn Meta insights data into PNG chart images for reports, presentations, or direct sharing. Choose from bar, line, pie, and other chart types.

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
titleYes
widthNo
heightNo
labelsYes
stackedNo
datasetsYes
chart_typeNobar
output_pathNoSave PNG to this file path
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 declare readOnly=false, idempotent=true, destructive=false; the description adds value by explaining output side effects (saves PNG to a path or returns a URL), mentioning the rendering service (QuickChart/Chart.js), and noting how the output can be used. It does not discuss network dependencies or failure modes, but this is above what annotations alone provide.

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 logically structured with an intro paragraph, 'Args:' block, 'Returns:' note, and an example. It is somewhat lengthy but justified given 10 parameters and a complex nested dataset object. No redundant sentences; each section earns its place.

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 10-parameter tool with low schema coverage, the description covers nearly all parameters, return behavior, and gives an example. The only gap is that the 'response_format' parameter (markdown/json) is not mentioned in the text, and there are no caveats about the QuickChart service (e.g., rate limits, URL length). Overall, it is quite complete.

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 only 20%, so the description carries the explanatory burden. It fully documents each parameter (chart_type, title, labels, datasets with nested structure, width, height, output_path, stacked, show_values), provides defaults, and includes a concrete example for datasets. This is far beyond the sparse schema descriptions and makes parameter meaning unambiguous.

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 opens with 'Generates a chart image (PNG) from provided data' – a specific verb, resource, and output format. It distinguishes itself from the sibling meta_generate_comparison_chart by focusing on general chart creation rather than comparison-specific charts, and includes a concrete use-case ('visual reports from Meta insights data').

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 phrase 'Perfect for creating visual reports from Meta insights data' gives clear context, but it does not explicitly state when not to use this tool or point to alternatives (e.g., meta_generate_comparison_chart). No exclusions or routing guidance beyond that single contextual sentence.

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/open-work-org/open-mcp-servers'

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