AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Faostat Compare

skill-berba-q-faostat-skills-compare · by berba-q

Use ONLY when the user explicitly asks to compare two or more specific named entities (countries, commodities, or regions) side by side. Keywords — compare, comparison, versus, vs, benchmark, countries, crops, production, yield, area harvested, trade, growth rate. Do NOT use for a global commodity briefing → `faostat-commodity`. Do NOT use for a country food security profile → `faostat-country-pr…

No reviews yet
0 installs
8 views
0.0% view→install

Install

$ agentstack add skill-berba-q-faostat-skills-compare

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-berba-q-faostat-skills-compare)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
5mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Faostat Compare? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Comparative Agricultural Analysis

Produce a structured side-by-side comparison of countries, commodities, or both across agricultural metrics using FAOSTAT data.

Prerequisites

Verify that the following FAOSTAT MCP tools are available before proceeding:

  • faostat_search_codes
  • faostat_get_data
  • faostat_get_rankings

If any tool is missing, inform the user: "This skill requires the FAOSTAT MCP server to be connected. Please ensure it is running and try again."

Workflow

Step 1: Clarify Comparison Parameters

Determine from the user's message (or ask if unclear):

  1. What to compare: Countries, commodities, or a cross-comparison (e.g., wheat production in Brazil vs. Argentina).
  2. Metric: Production volume, yield, area harvested, trade value, or another indicator. Default to production if unspecified.
  3. Time range: Specific years or a span. Default to the most recent 10 years if unspecified.
  4. Domain: Infer the FAOSTAT domain:
  • Production / yield / area harvested: QCL
  • Aggregate trade quantities or values for a country-commodity pair: TCL (not TM)
  • Bilateral trade by partner country: TM (use only if the user specifically asks about partners)
  • Food balance sheets (supply, dietary energy): FBS
  • Food security indicators: FS
  • Agrifood emissions: GT; temperature change: ET; land use: RL

Map the metric to the correct FAOSTAT element FILTER codes:

> Element codes below are verified hints. Resolve at runtime via faostat_search_codes before use.

  • Production (QCL): '2510'
  • Yield (QCL): '2413'
  • Area harvested (QCL): '2312'
  • Import quantity (TCL): '2610'; Export quantity (TCL): '2910'
  • Import value (TCL, USD 1000): '2612'; Export value (TCL, USD 1000): '2912'

Step 2: Resolve All Codes

For each entity (country or commodity), call faostat_search_codes:

Countries: faostat_search_codes(domain_code='', dimension_id='area', query='')

Commodities: faostat_search_codes(domain_code='', dimension_id='item', query='')

CRITICAL: If ANY search returns requires_confirmation: true, present the options to the user and wait for confirmation before proceeding. Resolve each entity independently — do not skip confirmation for any of them.

Store all confirmed codes.

Step 3: Pull Data for All Entities

For each entity combination, call faostat_get_data with:

  • domain_code=''
  • area='' (or comma-separated codes if comparing multiple countries for one item)
  • item='' (or comma-separated codes if comparing multiple items)
  • element='' — resolve first: faostat_search_codes(domain_code='', dimension_id='element', query='') → use the returned FILTER code; reference hints in Step 1 to validate
  • year='2014,2015,2016,2017,2018,2019,2020,2021,2022,2023' — use an explicit comma-separated year list. Colon ranges like '2014:2023' have returned empty in practice; avoid them.
  • response_format='compact' (saves tokens for multi-entity queries)
  • limit=200 (increase limit for multi-year, multi-entity queries)
  • show_unit=True

If comparing many entities, batch the calls to avoid excessively large responses. Prefer 2-4 entities per call.

China composite rule (user preference, Apr 2026). If any entity is "China" without qualification, use composite China (area code 351) — the roll-up of mainland + HK SAR + Macao SAR + Taiwan. Do NOT substitute China, mainland (41) unless the user asks for 41 explicitly. Note the choice in the methodology section and flag that FAOSTAT's own publications default to 41, so "China" values here are marginally larger than the FAO data-portal default.

Step 4: Calculate Derived Metrics

From the retrieved data, compute:

  • Growth rate: Percentage change from first year to last year in the range.
  • Average annual growth rate (CAGR): (end_value / start_value) ^ (1 / years) - 1
  • Period average: Mean value across all years.
  • Volatility (optional): Standard deviation of year-over-year changes, if the user is interested in stability.

Step 5: Present the Comparison

Structure the output as follows:

Title: Comparative Analysis: [Entity A] vs. [Entity B] [vs. Entity C...] — [Metric]

  1. Comparison Table — Tabular summary with entities as columns and years (or summary stats) as rows. Include units.
  1. Growth Rates — CAGR and total period change for each entity, clearly indicating which grew faster.
  1. Key Differences — Narrative highlighting:
  • Largest producer/highest yield/biggest trader
  • Fastest and slowest growth
  • Any crossover points (where one entity overtook another)
  • Notable divergences or convergences in trends
  1. Context & Insights — Brief interpretation:
  • Possible explanations for differences (climate, policy, investment)
  • Caveats about the data (reporting gaps, methodology changes)

End with:

> Source: FAOSTAT (FAO), accessed [current date].

Important Rules

Element and item code resolution. Never use a hardcoded numeric element or item code as the primary value in a faostat_get_data call. Always resolve at runtime: faostat_search_codes(domain_code='', dimension_id='element', query='') for elements; faostat_search_codes(domain_code='', dimension_id='item', query='') for items. Numeric codes shown in reference tables and code examples are verified hints — use them to validate the search result, not as the authoritative source. Domain letter-codes (QCL, TCL, GT, EM, FBS, FS…) are stable and may be used directly.

Error Handling

  • If data is missing for some years for an entity, note the gap and compute metrics on available data only.
  • If an entity has no data for the chosen domain/metric, inform the user and suggest an alternative metric or domain.
  • Limit comparisons to 5 entities maximum. If the user requests more, suggest narrowing the scope or running multiple comparisons.
  • faostat_get_rankings sometimes returns HTTP 500. If you need rankings for context (e.g., "show how Brazil ranks globally before comparing to Argentina"), fall back to faostat_get_data across reporting countries and sort client-side.
  • Colon year range returns empty. If year='2014:2023' produces no rows, retry with year='2014,2015,...,2023'.

Output Format

Use a clean tabular layout for numerical comparisons. Follow the table with a concise narrative analysis. Keep growth rate calculations transparent by showing the formula values used.

Related Skills

| If you need… | Use | |---|---| | Global commodity briefing | /faostat-commodity | | Country food security profile | /faostat-country-profile | | Trend ranking across commodities | /faostat-trends | | Import dependency / supply chain risk | /faostat-trade |

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.