European Parliament MCP Server API - v1.2.21
    Preparing search index...

    Function isCredibleApiValue

    • Check whether an API value is credible enough to overwrite the stored value.

      Returns false when the API clearly returned incomplete data:

      Guard 1 — tiny API value: API value is below MIN_CREDIBLE_VALUE AND stored value is much larger (> 5× the API value).

      Guard 2 — significant drop: Stored value is substantial (> MIN_STORED_FOR_DROP_CHECK) AND the API value represents a drop of more than MAX_ALLOWED_DROP_PERCENT% from stored. This catches scenarios where the EP API returns a plausible-looking number (e.g. 1998 speeches) that is nonetheless far below the known count (10000), indicating incomplete pagination or partial data loads.

      Both guards protect curated data from being overwritten by incomplete EP API responses while still allowing genuine corrections (increases and small decreases).

      Parameters

      • apiValue: number
      • storedValue: number

      Returns boolean