Skip to main content
Glama

faostat-mcp-server: commodity profile

faostat_commodity_profile
Read-only

Assemble a global profile for one commodity in a single call: top-producing countries, the annual production trend, and trade flows (top exporters and importers). Accepts a commodity name, resolves it to item codes, then queries the production (QCL) and trade (TCL) domains and merges the results. Each ranking is a per-country sum across the resolved items, taken at that country's own latest year with data and grouped by unit so incomparable quantities are never added. The trend is returned inline as year/value points. Country-level only (aggregates excluded). When a required domain is not indexed locally, returns a partial profile with a notice naming the gap rather than failing. The full merged observation set spills to a DataCanvas table for deeper SQL via faostat_dataframe_query.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
top_nNoNumber of top producers / exporters / importers to return. Max 50.
year_endNoInclusive end year for the trend (e.g. 2022).
canvas_idNoCanvas ID from a prior call to stage onto. Omit to start a fresh canvas.
item_queryYesCommodity name to profile (e.g. "maize", "wheat", "coffee green"). Matched by relevance; the 5 best-matching items are folded into one profile, so a broad name such as "milk" is narrowed — the response discloses how many items matched in total.
year_startNoInclusive start year for the trend (e.g. 1990).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorNoPresent when the call failed. Absent on success.
noticeNoNames any required domain that was not indexed, item-resolution truncation, mixed units in the rankings, or other partial-result context.
spilledNoTrue when the merged observation set was staged on a canvas table.
canvas_idNoCanvas ID holding the merged set — pass to faostat_dataframe_query / _describe.
truncatedNoTrue when the STAGED CANVAS TABLE hit the 50,000-row staging cap and is therefore a PREFIX of the merged observation set — re-query faostat_query_observations partitioned by year to stage the rest. The rankings and production_trend above are SQL aggregates over the complete match and stay exact either way.
item_queryNoThe commodity query echoed back.
table_nameNoCanvas table holding the staged observations — production plus trade when the trade domain (TCL) is indexed, production only when it is not (present when spilled). The notice names which of the two the table holds.
trend_pointsNoTotal production observations aggregated into production_trend. Exact — the aggregation runs over the complete filtered match, not a capped page.
top_exportersNoTop exporters by summed export quantity (empty when trade is not indexed).
top_importersNoTop importers by summed import quantity (empty when trade is not indexed).
top_producersNoTop producers by summed production (countries only).
itemsTruncatedNoTrue when the commodity name matched more items than the profile folded in — the profile then covers only the most relevant few.
resolved_itemsNoCommodities the query resolved to (the profile aggregates across all of them).
production_trendNoThe annual production series for the resolved commodity, summed over countries and items per year and ordered oldest-first. Aggregated in SQL over the complete filtered match, so it is not affected by the canvas staging cap.
staged_row_countNoRows actually staged on the merged canvas table (present when spilled). Equals the 50,000-row cap when truncated.
resolvedItemCodesNoItem codes the commodity query resolved to.
resolvedItemMatchesNoTotal items the commodity query matched in QCL, before the 5-item profile cap.

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already mark it read-only (readOnlyHint=true) and non-mutating. The description adds valuable behavioral context: it resolves item codes, groups rankings by unit to avoid adding incomparable quantities, returns partial profiles with a notice if a domain is missing, and stages the full dataset to a DataCanvas table. These details go beyond the annotations and help the agent anticipate failure modes and side effects.

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 several sentences long but each sentence earns its place: it covers purpose, method, edge cases, and the downstream handoff to a DataCanvas table. It is front-loaded with the key operation and resource, and the logical flow from purpose to behavior to failure handling makes it dense yet clear without unnecessary verbosity.

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?

Given the tool's complexity—multiple domains, merging, partial failures—the description covers the main scenarios: how rankings are computed, country-level scope, partial profile behavior when a domain is missing, and where to go for deeper analysis. The existence of an output schema covers return specifics, so the description doesn't need to explain that. It is complete enough for an agent to invoke correctly and know what to expect.

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

Parameters3/5

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

All five parameters are fully described in the schema (100% coverage), so the schema carries the parameter documentation burden. The description mostly repeats schema content, such as item_query matching by relevance and year range semantics. It adds no new parameter-specific meaning; the useful notes about unit grouping are behavioral rather than parameter-level.

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: 'Assemble a global profile for one commodity in a single call: top-producing countries, the annual production trend, and trade flows (top exporters and importers).' It specifies a concrete verb and resource, and the composite nature (merging production and trade domains) distinguishes it from the granular sibling tools like faostat_query_observations or faostat_resolve_codes.

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 implies usage for quickly building a commodity profile and mentions that deeper SQL is possible via faostat_dataframe_query after staging to a DataCanvas table. However, it does not explicitly contrast this composite tool with alternatives such as faostat_query_observations for raw data or faostat_resolve_codes for code resolution, leaving the decision of when to use this tool over others somewhat implicit.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

TDQS

A4.4/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose: discovery (list_domains), code resolution (resolve_codes), raw data query (query_observations), high-level profile assembly (commodity_profile), and dataframe management (describe/query). The composite profile tool overlaps slightly with query_observations, but its description clearly positions it as a convenience wrapper, eliminating ambiguity.

Naming Consistency4/5

All tools share the faostat_ prefix, and most use verb_noun structure (list_domains, query_observations, resolve_codes, dataframe_describe, dataframe_query). The exception is commodity_profile, which is a noun_phrase rather than verb-first, though it is still descriptive and follows the overall underscore convention. This minor deviation keeps the set mostly consistent.

Tool Count5/5

With 6 tools, the server is well-scoped for its purpose: it covers the essential workflow of discovering domains, resolving codes, querying data, and analyzing results via dataframes. Each tool has a clear role, and the count is appropriate for a focused statistical data server without excess or deficiency.

Completeness5/5

The tool surface covers the full data retrieval lifecycle: domain discovery, code resolution, raw data extraction, and flexible post-query analysis (including a high-level commodity profile shortcut). The descriptions handle edge cases like aggregation exclusion and flag validation, and no obvious gaps exist for a read-only FAOSTAT querying server.