Skip to main content
Glama

Corridor month-over-month anomalies

exim__analytics__anomalies
Read-onlyIdempotent

Flags months where a measure spikes or drops past a threshold for a destination, origin and/or HS code. Use it to spot unusual movement in a corridor.

Input Schema

NameRequiredDescriptionDefault
hsCodeNoHS code at 2, 4 or 6 digits; shorter codes match the whole family (0901 = all coffee). Do not pad with zeros (090100 matches nothing).
measureNoMeasure to watch: value_usd (default), weight_kg, shipment_count, ...
originCountryNoOrigin (exporting) country, ISO2 code (e.g. VN).
destinationCountryNoDestination (importing) country, ISO2 code (e.g. US, DE).

Output Schema

NameRequiredDescriptionDefault
dataYes
statsNo
_debugNo
summaryYes
warningsNo
nextActionsYes
correlationIdNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changed
    • changedInput schema / not / anyOf
      Previous value: -[
      -  {
      -    "not": {
      -      "x-argumentRequirement": {
      -        "if": {
      -          "allOf": []
      -        },
      -        "then": {
      -          "anyOf": [
      -            {
      -              "properties": {
      -                "dest": {
      -                  "minLength": 1,
      -                  "type": "string"
      -                }
      -              },
      -              "required": [
      -                "dest"
      -              ]
      -            },
      -            {
      -              "properties": {
      -                "origin": {
      -                  "minLength": 1,
      -                  "type": "string"
      -                }
      -              },
      -              "required": [
      -                "origin"
      -              ]
      -            },
      -            {
      -              "properties": {
      -                "hs6": {
      -                  "minLength": 1,
      -                  "type": "string"
      -                }
      -              },
      -              "required": [
      -                "hs6"
      -              ]
      -            }
      -          ]
      -        }
      -      }
      -    }
      -  }
      -]New value: +[
      +  {
      +    "not": {
      +      "x-argumentRequirement": {
      +        "if": {
      +          "allOf": []
      +        },
      +        "then": {
      +          "anyOf": [
      +            {
      +              "properties": {
      +                "destinationCountry": {
      +                  "minLength": 1,
      +                  "type": "string"
      +                }
      +              },
      +              "required": [
      +                "destinationCountry"
      +              ]
      +            },
      +            {
      +              "properties": {
      +                "originCountry": {
      +                  "minLength": 1,
      +                  "type": "string"
      +                }
      +              },
      +              "required": [
      +                "originCountry"
      +              ]
      +            },
      +            {
      +              "properties": {
      +                "hsCode": {
      +                  "minLength": 1,
      +                  "type": "string"
      +                }
      +              },
      +              "required": [
      +                "hsCode"
      +              ]
      +            }
      +          ]
      +        }
      +      }
      +    }
      +  }
      +]
    • removedInput schema / properties / dest
      Removed value: -{
      -  "description": "Destination country to scan (ISO)",
      -  "maxLength": 120,
      -  "type": "string"
      -}
    • addedInput schema / properties / destinationCountry
      Added value: +{
      +  "description": "Destination (importing) country, ISO2 code (e.g. US, DE).",
      +  "maxLength": 120,
      +  "type": "string"
      +}
    • removedInput schema / properties / hs6
      Removed value: -{
      -  "description": "HS code at ANY granularity — 2/4/6-digit; a shorter code is a broader family (e.g. 0901 = all coffee). Do NOT pad to 6 digits: 090100 matches nothing.",
      -  "maxLength": 120,
      -  "type": "string"
      -}
    • addedInput schema / properties / hsCode
      Added value: +{
      +  "description": "HS code at 2, 4 or 6 digits; shorter codes match the whole family (0901 = all coffee). Do not pad with zeros (090100 matches nothing).",
      +  "maxLength": 120,
      +  "type": "string"
      +}
    • removedInput schema / properties / origin
      Removed value: -{
      -  "description": "Origin country to scan (ISO)",
      -  "maxLength": 120,
      -  "type": "string"
      -}
    • addedInput schema / properties / originCountry
      Added value: +{
      +  "description": "Origin (exporting) country, ISO2 code (e.g. VN).",
      +  "maxLength": 120,
      +  "type": "string"
      +}
  2. Changed7 schema fields changed
    • changedInput schema / not / anyOf
      Previous value: -[
      -  {
      -    "not": {
      -      "x-argumentRequirement": {
      -        "if": {
      -          "allOf": []
      -        },
      -        "then": {
      -          "anyOf": [
      -            {
      -              "properties": {
      -                "destinationCountry": {
      -                  "minLength": 1,
      -                  "type": "string"
      -                }
      -              },
      -              "required": [
      -                "destinationCountry"
      -              ]
      -            },
      -            {
      -              "properties": {
      -                "originCountry": {
      -                  "minLength": 1,
      -                  "type": "string"
      -                }
      -              },
      -              "required": [
      -                "originCountry"
      -              ]
      -            },
      -            {
      -              "properties": {
      -                "hsCode": {
      -                  "minLength": 1,
      -                  "type": "string"
      -                }
      -              },
      -              "required": [
      -                "hsCode"
      -              ]
      -            }
      -          ]
      -        }
      -      }
      -    }
      -  }
      -]New value: +[
      +  {
      +    "not": {
      +      "x-argumentRequirement": {
      +        "if": {
      +          "allOf": []
      +        },
      +        "then": {
      +          "anyOf": [
      +            {
      +              "properties": {
      +                "dest": {
      +                  "minLength": 1,
      +                  "type": "string"
      +                }
      +              },
      +              "required": [
      +                "dest"
      +              ]
      +            },
      +            {
      +              "properties": {
      +                "origin": {
      +                  "minLength": 1,
      +                  "type": "string"
      +                }
      +              },
      +              "required": [
      +                "origin"
      +              ]
      +            },
      +            {
      +              "properties": {
      +                "hs6": {
      +                  "minLength": 1,
      +                  "type": "string"
      +                }
      +              },
      +              "required": [
      +                "hs6"
      +              ]
      +            }
      +          ]
      +        }
      +      }
      +    }
      +  }
      +]
    • addedInput schema / properties / dest
      Added value: +{
      +  "description": "Destination country to scan (ISO)",
      +  "maxLength": 120,
      +  "type": "string"
      +}
    • removedInput schema / properties / destinationCountry
      Removed value: -{
      -  "description": "Destination (importing) country, ISO2 code (e.g. US, DE).",
      -  "maxLength": 120,
      -  "type": "string"
      -}
    • addedInput schema / properties / hs6
      Added value: +{
      +  "description": "HS code at ANY granularity — 2/4/6-digit; a shorter code is a broader family (e.g. 0901 = all coffee). Do NOT pad to 6 digits: 090100 matches nothing.",
      +  "maxLength": 120,
      +  "type": "string"
      +}
    • removedInput schema / properties / hsCode
      Removed value: -{
      -  "description": "HS code at 2, 4 or 6 digits; shorter codes match the whole family (0901 = all coffee). Do not pad with zeros (090100 matches nothing).",
      -  "maxLength": 120,
      -  "type": "string"
      -}
    • addedInput schema / properties / origin
      Added value: +{
      +  "description": "Origin country to scan (ISO)",
      +  "maxLength": 120,
      +  "type": "string"
      +}
    • removedInput schema / properties / originCountry
      Removed value: -{
      -  "description": "Origin (exporting) country, ISO2 code (e.g. VN).",
      -  "maxLength": 120,
      -  "type": "string"
      -}
  3. Changed7 schema fields changed
    • changedInput schema / not / anyOf
      Previous value: -[
      -  {
      -    "not": {
      -      "x-argumentRequirement": {
      -        "if": {
      -          "allOf": []
      -        },
      -        "then": {
      -          "anyOf": [
      -            {
      -              "properties": {
      -                "dest": {
      -                  "minLength": 1,
      -                  "type": "string"
      -                }
      -              },
      -              "required": [
      -                "dest"
      -              ]
      -            },
      -            {
      -              "properties": {
      -                "origin": {
      -                  "minLength": 1,
      -                  "type": "string"
      -                }
      -              },
      -              "required": [
      -                "origin"
      -              ]
      -            },
      -            {
      -              "properties": {
      -                "hs6": {
      -                  "minLength": 1,
      -                  "type": "string"
      -                }
      -              },
      -              "required": [
      -                "hs6"
      -              ]
      -            }
      -          ]
      -        }
      -      }
      -    }
      -  }
      -]New value: +[
      +  {
      +    "not": {
      +      "x-argumentRequirement": {
      +        "if": {
      +          "allOf": []
      +        },
      +        "then": {
      +          "anyOf": [
      +            {
      +              "properties": {
      +                "destinationCountry": {
      +                  "minLength": 1,
      +                  "type": "string"
      +                }
      +              },
      +              "required": [
      +                "destinationCountry"
      +              ]
      +            },
      +            {
      +              "properties": {
      +                "originCountry": {
      +                  "minLength": 1,
      +                  "type": "string"
      +                }
      +              },
      +              "required": [
      +                "originCountry"
      +              ]
      +            },
      +            {
      +              "properties": {
      +                "hsCode": {
      +                  "minLength": 1,
      +                  "type": "string"
      +                }
      +              },
      +              "required": [
      +                "hsCode"
      +              ]
      +            }
      +          ]
      +        }
      +      }
      +    }
      +  }
      +]
    • removedInput schema / properties / dest
      Removed value: -{
      -  "description": "Destination country to scan (ISO)",
      -  "maxLength": 120,
      -  "type": "string"
      -}
    • addedInput schema / properties / destinationCountry
      Added value: +{
      +  "description": "Destination (importing) country, ISO2 code (e.g. US, DE).",
      +  "maxLength": 120,
      +  "type": "string"
      +}
    • removedInput schema / properties / hs6
      Removed value: -{
      -  "description": "HS code at ANY granularity — 2/4/6-digit; a shorter code is a broader family (e.g. 0901 = all coffee). Do NOT pad to 6 digits: 090100 matches nothing.",
      -  "maxLength": 120,
      -  "type": "string"
      -}
    • addedInput schema / properties / hsCode
      Added value: +{
      +  "description": "HS code at 2, 4 or 6 digits; shorter codes match the whole family (0901 = all coffee). Do not pad with zeros (090100 matches nothing).",
      +  "maxLength": 120,
      +  "type": "string"
      +}
    • removedInput schema / properties / origin
      Removed value: -{
      -  "description": "Origin country to scan (ISO)",
      -  "maxLength": 120,
      -  "type": "string"
      -}
    • addedInput schema / properties / originCountry
      Added value: +{
      +  "description": "Origin (exporting) country, ISO2 code (e.g. VN).",
      +  "maxLength": 120,
      +  "type": "string"
      +}
  4. Changed10 schema fields changed
    • addedInput schema / not
      Added value: +{
      +  "anyOf": [
      +    {
      +      "not": {
      +        "x-argumentRequirement": {
      +          "if": {
      +            "allOf": []
      +          },
      +          "then": {
      +            "anyOf": [
      +              {
      +                "properties": {
      +                  "dest": {
      +                    "minLength": 1,
      +                    "type": "string"
      +                  }
      +                },
      +                "required": [
      +                  "dest"
      +                ]
      +              },
      +              {
      +                "properties": {
      +                  "origin": {
      +                    "minLength": 1,
      +                    "type": "string"
      +                  }
      +                },
      +                "required": [
      +                  "origin"
      +                ]
      +              },
      +              {
      +                "properties": {
      +                  "hs6": {
      +                    "minLength": 1,
      +                    "type": "string"
      +                  }
      +                },
      +                "required": [
      +                  "hs6"
      +                ]
      +              }
      +            ]
      +          }
      +        }
      +      }
      +    }
      +  ]
      +}
    • removedInput schema / properties / --dest
      Removed value: -{
      -  "description": "Destination country to scan (ISO)",
      -  "type": "string"
      -}
    • removedInput schema / properties / --hs6
      Removed value: -{
      -  "description": "HS code at ANY granularity — 2/4/6-digit; a shorter code is a broader family (e.g. 0901 = all coffee). Do NOT pad to 6 digits: 090100 matches nothing.",
      -  "type": "string"
      -}
    • removedInput schema / properties / --measure
      Removed value: -{
      -  "description": "Measure to watch: value_usd (default), weight_kg, shipment_count, ...",
      -  "type": "string"
      -}
    • removedInput schema / properties / --origin
      Removed value: -{
      -  "description": "Origin country to scan (ISO)",
      -  "type": "string"
      -}
    • addedInput schema / properties / dest
      Added value: +{
      +  "description": "Destination country to scan (ISO)",
      +  "maxLength": 120,
      +  "type": "string"
      +}
    • addedInput schema / properties / hs6
      Added value: +{
      +  "description": "HS code at ANY granularity — 2/4/6-digit; a shorter code is a broader family (e.g. 0901 = all coffee). Do NOT pad to 6 digits: 090100 matches nothing.",
      +  "maxLength": 120,
      +  "type": "string"
      +}
    • addedInput schema / properties / measure
      Added value: +{
      +  "description": "Measure to watch: value_usd (default), weight_kg, shipment_count, ...",
      +  "maxLength": 120,
      +  "type": "string"
      +}
    • addedInput schema / properties / origin
      Added value: +{
      +  "description": "Origin country to scan (ISO)",
      +  "maxLength": 120,
      +  "type": "string"
      +}
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$defs": {
      +    "value0": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "anomalies": {
      +          "$ref": "#/$defs/value2"
      +        },
      +        "coverage": {
      +          "$ref": "#/$defs/value4"
      +        },
      +        "measure": {
      +          "type": "string"
      +        },
      +        "monthsScanned": {
      +          "type": "integer"
      +        },
      +        "scope": {
      +          "$ref": "#/$defs/value1"
      +        },
      +        "thresholdPct": {
      +          "type": "number"
      +        },
      +        "verdict": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "anomalies",
      +        "coverage",
      +        "measure",
      +        "monthsScanned",
      +        "scope",
      +        "thresholdPct",
      +        "verdict"
      +      ],
      +      "type": "object"
      +    },
      +    "value1": {
      +      "anyOf": [
      +        {
      +          "additionalProperties": {
      +            "type": "string"
      +          },
      +          "type": "object"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "value10": {
      +      "anyOf": [
      +        {
      +          "additionalProperties": {
      +            "type": "number"
      +          },
      +          "type": "object"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "value11": {
      +      "anyOf": [
      +        {
      +          "items": {
      +            "$ref": "#/$defs/value12"
      +          },
      +          "type": "array"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "value12": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "code": {
      +          "type": "string"
      +        },
      +        "message": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "code",
      +        "message"
      +      ],
      +      "type": "object"
      +    },
      +    "value13": {
      +      "anyOf": [
      +        {
      +          "additionalProperties": {
      +            "type": [
      +              "null",
      +              "boolean",
      +              "number",
      +              "string",
      +              "array",
      +              "object"
      +            ]
      +          },
      +          "type": "object"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "value2": {
      +      "anyOf": [
      +        {
      +          "items": {
      +            "$ref": "#/$defs/value3"
      +          },
      +          "type": "array"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "value3": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "changePct": {
      +          "type": "number"
      +        },
      +        "kind": {
      +          "type": "string"
      +        },
      +        "lowConfidence": {
      +          "type": "boolean"
      +        },
      +        "measure": {
      +          "type": "string"
      +        },
      +        "month": {
      +          "type": "string"
      +        },
      +        "prevValue": {
      +          "type": "number"
      +        },
      +        "value": {
      +          "type": "number"
      +        }
      +      },
      +      "required": [
      +        "changePct",
      +        "kind",
      +        "lowConfidence",
      +        "measure",
      +        "month",
      +        "prevValue",
      +        "value"
      +      ],
      +      "type": "object"
      +    },
      +    "value4": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "blindSpot": {
      +          "type": "string"
      +        },
      +        "confidence": {
      +          "anyOf": [
      +            {
      +              "type": "number"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ]
      +        },
      +        "country": {
      +          "$ref": "#/$defs/value5"
      +        },
      +        "display": {
      +          "type": "string"
      +        },
      +        "period": {
      +          "$ref": "#/$defs/value6"
      +        },
      +        "scope": {
      +          "type": "string"
      +        },
      +        "status": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "confidence",
      +        "country",
      +        "display",
      +        "period",
      +        "status"
      +      ],
      +      "type": "object"
      +    },
      +    "value5": {
      +      "anyOf": [
      +        {
      +          "items": {
      +            "type": "string"
      +          },
      +          "type": "array"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "value6": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "end": {
      +          "type": "string"
      +        },
      +        "start": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "end",
      +        "start"
      +      ],
      +      "type": "object"
      +    },
      +    "value7": {
      +      "anyOf": [
      +        {
      +          "items": {
      +            "type": [
      +              "null",
      +              "boolean",
      +              "number",
      +              "string",
      +              "array",
      +              "object"
      +            ]
      +          },
      +          "type": "array"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "value8": {
      +      "anyOf": [
      +        {
      +          "items": {
      +            "$ref": "#/$defs/value9"
      +          },
      +          "type": "array"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "value9": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "command": {
      +          "type": "string"
      +        },
      +        "cost": {
      +          "type": "string"
      +        },
      +        "label": {
      +          "type": "string"
      +        },
      +        "rationale": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "command",
      +        "cost",
      +        "label",
      +        "rationale"
      +      ],
      +      "type": "object"
      +    }
      +  },
      +  "additionalProperties": false,
      +  "properties": {
      +    "_debug": {
      +      "$ref": "#/$defs/value13"
      +    },
      +    "correlationId": {
      +      "type": "string"
      +    },
      +    "data": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "context": {
      +          "type": [
      +            "null",
      +            "boolean",
      +            "number",
      +            "string",
      +            "array",
      +            "object"
      +          ]
      +        },
      +        "cursor": {
      +          "type": "string"
      +        },
      +        "has_more": {
      +          "type": "boolean"
      +        },
      +        "items": {
      +          "anyOf": [
      +            {
      +              "items": {
      +                "$ref": "#/$defs/value0"
      +              },
      +              "type": "array"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ]
      +        }
      +      },
      +      "required": [
      +        "context",
      +        "has_more",
      +        "items"
      +      ],
      +      "type": "object"
      +    },
      +    "nextActions": {
      +      "$ref": "#/$defs/value8"
      +    },
      +    "stats": {
      +      "$ref": "#/$defs/value10"
      +    },
      +    "summary": {
      +      "type": "string"
      +    },
      +    "warnings": {
      +      "$ref": "#/$defs/value11"
      +    }
      +  },
      +  "required": [
      +    "data",
      +    "nextActions",
      +    "summary"
      +  ],
      +  "type": "object"
      +}
  5. First observed

TDQS

A3.5/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint=false, so the safety profile is covered. The description adds the threshold-spike mechanism, but leaves the key behavioral question unanswered: what the threshold is, whether it is fixed, and how sensitive the flagging is.

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?

Two sentences, no filler, with the core behavior front-loaded and the usage note trailing. Every clause earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Output schema exists, so return values need no explanation, and annotations cover safety. However, the description's central concept (a threshold) is never defined and has no corresponding parameter, and the relationship to exim__market__anomalies is unaddressed, leaving a real gap for an agent deciding how to invoke it.

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 description coverage is 100%, so the schema fully documents hsCode, measure, originCountry, and destinationCountry with formats and defaults. The description only restates the filter dimensions already in the schema, adding no syntax or semantic value beyond it. Baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource: flags months where a measure spikes or drops past a threshold, scoped to a destination/origin/HS code corridor. Clear enough for an agent to understand what it returns, but it never distinguishes itself from the sibling exim__market__anomalies, which reads as the same concept without the corridor scoping.

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?

"Use it to spot unusual movement in a corridor" implies the usage context but gives no when-not conditions, prerequisites, or alternatives. An agent choosing between this and exim__market__anomalies or exim__analytics__query gets no routing signal.

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.