Skip to main content
Glama

Trade Bilateral Analysis

trade_bilateral_analysis
Read-onlyIdempotent

Compare trade flows between two countries. Returns bilateral imports, exports, top commodities, and exchange rates. Use country codes (e.g., 842 for US, 156 for China, 276 for Germany, 392 for Japan, 826 for UK).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
yearNoTrade year (default: last year)
_fredKeyNoFRED API key (optional, for dollar index)
partner_codeYesPartner country code (e.g., "156" for China)
reporter_codeYesReporting country code (e.g., "842" for US)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
yearYesTrade year analyzed
exportsYesBilateral export data from Comtrade
importsYesBilateral import data from Comtrade
analysisYesAnalysis type identifier
dollar_indexYesTrade-weighted dollar index from FRED if key provided
partner_codeYesPartner country code
reporter_codeYesReporting country code
exchange_ratesYesExchange rates from Treasury
us_trade_balanceYesUS trade balance if reporter is US, null otherwise
top_commodities_importedYesTop 10 imported commodities

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "analysis": {
      +      "description": "Analysis type identifier",
      +      "type": "string"
      +    },
      +    "dollar_index": {
      +      "description": "Trade-weighted dollar index from FRED if key provided",
      +      "type": [
      +        "object",
      +        "null"
      +      ]
      +    },
      +    "exchange_rates": {
      +      "description": "Exchange rates from Treasury",
      +      "type": [
      +        "object",
      +        "null"
      +      ]
      +    },
      +    "exports": {
      +      "description": "Bilateral export data from Comtrade",
      +      "type": [
      +        "object",
      +        "null"
      +      ]
      +    },
      +    "imports": {
      +      "description": "Bilateral import data from Comtrade",
      +      "type": [
      +        "object",
      +        "null"
      +      ]
      +    },
      +    "partner_code": {
      +      "description": "Partner country code",
      +      "type": "string"
      +    },
      +    "reporter_code": {
      +      "description": "Reporting country code",
      +      "type": "string"
      +    },
      +    "top_commodities_imported": {
      +      "description": "Top 10 imported commodities",
      +      "type": [
      +        "object",
      +        "null"
      +      ]
      +    },
      +    "us_trade_balance": {
      +      "description": "US trade balance if reporter is US, null otherwise",
      +      "type": [
      +        "object",
      +        "null"
      +      ]
      +    },
      +    "year": {
      +      "description": "Trade year analyzed",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "analysis",
      +    "reporter_code",
      +    "partner_code",
      +    "year",
      +    "imports",
      +    "exports",
      +    "top_commodities_imported",
      +    "exchange_rates",
      +    "us_trade_balance",
      +    "dollar_index"
      +  ],
      +  "type": "object"
      +}
  2. Changed1 schema field changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "partner_code": "156",
      +    "reporter_code": "842"
      +  },
      +  {
      +    "_fredKey": "your-trade-intel-api-key",
      +    "partner_code": "392",
      +    "reporter_code": "276",
      +    "year": "2023"
      +  }
      +]
  3. First observed

TDQS

A3.8/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, openWorldHint, idempotentHint, destructiveHint. The description adds that it returns bilateral imports, exports, top commodities, and exchange rates, which is useful but does not reveal additional behavioral traits beyond what annotations imply.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, front-loaded with the purpose, and includes essential context without any fluff.

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 that an output schema exists and annotations cover safety, the description provides a good overview of inputs and outputs. It could mention default year behavior, but the schema already covers that. Overall adequate.

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?

Schema coverage is 100% with descriptions for all 4 parameters. The description adds example country codes and defaults, but these are also present in the schema's examples array. The description provides marginal added value.

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 compares trade flows between two countries and lists returned data (imports, exports, top commodities, exchange rates). It distinguishes from sibling tools like trade_country_profile and trade_macro_dashboard by focusing on bilateral analysis.

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 examples of country codes but does not explicitly state when to use this tool versus alternatives or when not to use it. The context is clear but lacks exclusion criteria.

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.

Resources