Skip to main content
Glama
Malja MCP

Malja MCP

Official

Generate chart

generate_chart
Read-only

Render displacement metrics for up to five countries as Chart.js, Vega-Lite, Mermaid, or SVG chart specifications, with optional normalization and changepoint markers.

Instructions

Render a displacement metric for one or more countries as a chart specification. Formats: "chartjs" (Chart.js v4 config JSON), "vega-lite" (v5 spec), "mermaid" (xychart block), "svg" (standalone image markup). Set normalize_by to plot per 1,000 residents or per US$1bn GDP. show_changepoints=true marks detected structural breaks (svg, vega-lite; Chart.js via chartjs-plugin-annotation).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "countries": "<countries>",
      "format": "<format>"
    },
    "name": "generate_chart"
  }
}

Input Schema

NameRequiredDescriptionDefault
kindNoChart type (default line)
roleNo"asylum" = people hosted IN the country; "origin" = people displaced FROM the country
formatYesOutput format
localeNoLanguage of the human-readable text output: "en" (default) or "ar" (Modern Standard Arabic, right-to-left). Structured JSON fields, ISO3 codes and dataset ids stay in English either way.
metricNoMetric to plot (default refugees)
year_toNoLast year of the range (default: latest available)
countriesYesCountries to plot
year_fromNoFirst year of the range (default: 10 years back)
normalize_byNoNormalize values by a denominator: "population" → per 1,000 residents, "gdp" → per US$1bn GDP. Requires the worldbank provider.
show_changepointsNoMark detected changepoints (structural breaks) per series. Default false.

Output Schema

NameRequiredDescriptionDefault
specYes
unitYes
titleYes
formatYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.8.0
    • removedInput schema / additionalProperties
      Removed value: -false
    • changedOutput schema / properties / spec / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": {},
      -    "type": "object"
      -  },
      -  {
      -    "type": "string"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": {},
      +    "propertyNames": {
      +      "type": "string"
      +    },
      +    "type": "object"
      +  },
      +  {
      +    "type": "string"
      +  }
      +]
  2. First observedv0.7.0

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnly and openWorld, so the bar is lower, yet the description adds real behavioral context: a provider dependency for normalization, and format-specific rendering limits for changepoint markers (SVG and vega-lite native, Chart.js only via chartjs-plugin-annotation). It does not cover failure modes, e.g. what happens when a metric is unavailable for the requested role, which keeps it from a 5.

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?

Four dense sentences, no preamble, with the core action front-loaded and option details after. The format enumeration is essentially a list but every item carries differentiating information (versions, artifact type), so nothing is wasted.

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?

With 10 parameters, full schema coverage, an output schema, and readOnly/openWorld annotations, the description covers the gaps structured fields cannot: per-format rendering capability and provider dependency. It stops short of describing behavior for invalid or unavailable metrics, which is the main remaining unknown for a 10-parameter tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3; the description earns above that by adding meaning the schema lacks — the plugin requirement for chartjs changepoints and the concrete version artifacts per format. It repeats the normalization denominators already documented in the schema, which limits the upside.

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?

States a specific verb and resource: 'Render a displacement metric for one or more countries as a chart specification.' The four output formats and their concrete artifacts (Chart.js v4 config JSON, vega-lite v5 spec, mermaid xychart block, standalone SVG) make it unmistakably a charting tool rather than a map (generate_map) or a data comparison (compare_countries).

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?

Usage is implied by the resource — you call this when you want a chart — but the description never states when to prefer it over generate_map, trend_analysis, or compare_countries, nor any prerequisites. The only conditional guidance is per-option (normalize_by requires the worldbank provider, show_changepoints works differently per format), not tool-selection guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.