Skip to main content
Glama

Get GDELT Tone Distribution

gdelt_get_tone_distribution
Read-only

Get the tonal distribution of articles matching a query as a histogram (bins approximately -30 to +30). Unlike a single average tone score, the histogram reveals whether coverage is uniformly negative, bimodal (some articles extremely positive and some extremely negative), or clustered near neutral. Each bin carries its first 3 representative article links and referenceCount, how many GDELT returned; name bins in the bins input to get only those bins, each with every link. A response carries as many whole bins as fit its size budget; when more remain it returns nextOffset — pass it back as offset with otherwise identical inputs for the next page. Distinct from gdelt_get_coverage_timeline (mode: tone) — this is a snapshot distribution across all matching articles, not a time series. Use gdelt_get_coverage_timeline with mode "tone" to see how sentiment shifted over time.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
binsNoTone bins to return alone, e.g. [-7, 4]. Take them from histogram[].bin in a prior response, or from the list an unknown_bin error prints. The response then carries only these bins, in histogram order, each with every representative article link instead of the first 3. A value matching no bin is rejected rather than silently ignored.
queryYesSearch query using GDELT syntax. Same operators as gdelt_search_articles: phrases, boolean OR, sourcecountry:, sourcelang:, domain:, theme: (GKG theme identifiers come from gdelt_search_themes).
offsetNoZero-based bin offset — into the histogram, or into the bins named in bins. Pass nextOffset from the preceding response, with otherwise identical inputs, to get the next page.
timespanNoTime window relative to now, minimum "15min"; other examples: "24h", "7d", "1m". Ignored when startDatetime/endDatetime are set. Maximum 3 months.
endDatetimeNoEnd datetime in GDELT format YYYYMMDDHHMMSS — exactly 14 digits, no separators (e.g. 20240131235959). Must pair with startDatetime; supplying only one of the two is rejected.
startDatetimeNoStart datetime in GDELT format YYYYMMDDHHMMSS — exactly 14 digits, no separators (e.g. 20240101000000). Must pair with endDatetime; supplying only one of the two is rejected.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorNoPresent when the call failed. Absent on success.
noticeNoGuidance when no articles matched in the window — how to broaden the query or extend the window — or, when this response is one page of several, which bins it returned out of how many. Absent when the whole histogram fit in one response.
summaryNoSummary statistics derived from the whole histogram, not this page. Each value is omitted when the histogram cannot support it — all of them on an empty result.
histogramNoThe bins of this page, sorted from most negative to most positive — the whole histogram when it fits.
nextOffsetNoOffset of the next page, for the same inputs. Absent when this page reaches the last bin.
totalCountNoTotal number of articles across all histogram bins, not only this page.
endDatetimeNoEchoed end datetime when provided (YYYYMMDDHHMMSS).
startDatetimeNoEchoed start datetime when provided (YYYYMMDDHHMMSS).
effectiveQueryNoEchoed query string for use in follow-up calls.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed12 schema fields changed
    • addedInput schema / properties / bins
      Added value: +{
      +  "description": "Tone bins to return alone, e.g. [-7, 4]. Take them from histogram[].bin in a prior response, or from the list an unknown_bin error prints. The response then carries only these bins, in histogram order, each with every representative article link instead of the first 3. A value matching no bin is rejected rather than silently ignored.",
      +  "items": {
      +    "maximum": 9007199254740991,
      +    "minimum": -9007199254740991,
      +    "type": "integer"
      +  },
      +  "type": "array"
      +}
    • addedInput schema / properties / offset
      Added value: +{
      +  "default": 0,
      +  "description": "Zero-based bin offset — into the histogram, or into the bins named in bins. Pass nextOffset from the preceding response, with otherwise identical inputs, to get the next page.",
      +  "maximum": 9007199254740991,
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `invalid_date_range`: Only one of startDatetime / endDatetime was supplied, one of them is not a real UTC calendar timestamp, or startDatetime is not earlier than endDatetime. `invalid_query`: GDELT rejected the query string as malformed — bad keyword length, unbalanced parentheses, or an illegal character. `gdelt_rate_limited`: GDELT rejected the request for its one-request-per-five-seconds limit, or too many requests were already queued for this one to start in time. `gdelt_unavailable`: GDELT DOC API is unreachable or temporarily returned no usable data. Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `unknown_bin`: A value passed in the bins input matches no bin in a non-empty histogram. `offset_out_of_range`: The requested offset is at or beyond the last bin of a non-empty histogram, or of the bins named in bins. `invalid_date_range`: Only one of startDatetime / endDatetime was supplied, one of them is not a real UTC calendar timestamp, or startDatetime is not earlier than endDatetime. `invalid_query`: GDELT rejected the query string as malformed — bad keyword length, unbalanced parentheses, or an illegal character. `gdelt_rate_limited`: GDELT rejected the request for its one-request-per-five-seconds limit, or too many requests were already queued for this one to start in time. `gdelt_unavailable`: GDELT DOC API is unreachable or temporarily returned no usable data. Other values are possible when a failure originates below the handler."
    • changedOutput schema / properties / error / properties / data / properties / reason / examples
      Previous value: -[
      -  "invalid_date_range",
      -  "invalid_query",
      -  "gdelt_rate_limited",
      -  "gdelt_unavailable"
      -]New value: +[
      +  "unknown_bin",
      +  "offset_out_of_range",
      +  "invalid_date_range",
      +  "invalid_query",
      +  "gdelt_rate_limited",
      +  "gdelt_unavailable"
      +]
    • changedOutput schema / properties / histogram / description
      Previous value: -"Tone histogram sorted from most negative to most positive bin."New value: +"The bins of this page, sorted from most negative to most positive — the whole histogram when it fits."
    • changedOutput schema / properties / histogram / items / properties / articles / description
      Previous value: -"Representative articles in this tone bin."New value: +"Representative articles in this tone bin — the first 3, or all of them for a bin named in bins."
    • addedOutput schema / properties / histogram / items / properties / referenceCount
      Added value: +{
      +  "description": "How many representative articles GDELT returned for this bin; articles carries the first 3 unless the bin was named in bins.",
      +  "type": "number"
      +}
    • changedOutput schema / properties / histogram / items / required
      Previous value: -[
      -  "bin",
      -  "count",
      -  "articles"
      -]New value: +[
      +  "bin",
      +  "count",
      +  "articles",
      +  "referenceCount"
      +]
    • addedOutput schema / properties / nextOffset
      Added value: +{
      +  "description": "Offset of the next page, for the same inputs. Absent when this page reaches the last bin.",
      +  "type": "number"
      +}
    • changedOutput schema / properties / notice / description
      Previous value: -"Guidance when no articles matched in the window — how to broaden the query or extend the window. Absent when tone data was returned."New value: +"Guidance when no articles matched in the window — how to broaden the query or extend the window — or, when this response is one page of several, which bins it returned out of how many. Absent when the whole histogram fit in one response."
    • changedOutput schema / properties / summary / description
      Previous value: -"Summary statistics derived from the histogram. Each value is omitted when the histogram cannot support it — all of them on an empty result."New value: +"Summary statistics derived from the whole histogram, not this page. Each value is omitted when the histogram cannot support it — all of them on an empty result."
    • changedOutput schema / properties / totalCount / description
      Previous value: -"Total number of articles across all histogram bins."New value: +"Total number of articles across all histogram bins, not only this page."
  2. Changed1 schema field changed
    • changedInput schema / properties / query / description
      Previous value: -"Search query using GDELT syntax. Same operators as gdelt_search_articles: phrases, boolean OR, sourcecountry:, sourcelang:, domain:, theme:."New value: +"Search query using GDELT syntax. Same operators as gdelt_search_articles: phrases, boolean OR, sourcecountry:, sourcelang:, domain:, theme: (GKG theme identifiers come from gdelt_search_themes)."
  3. Changed8 schema fields changed
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `no_tone_data`: No tone histogram data returned for the query. `invalid_date_range`: Only one of startDatetime / endDatetime was supplied, one of them is not a real UTC calendar timestamp, or startDatetime is not earlier than endDatetime. `invalid_query`: GDELT rejected the query string as malformed — bad keyword length, unbalanced parentheses, or an illegal character. `gdelt_rate_limited`: GDELT rejected the request for its one-request-per-five-seconds limit, or too many requests were already queued for this one to start in time. `gdelt_unavailable`: GDELT DOC API is unreachable or temporarily returned no usable data. Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `invalid_date_range`: Only one of startDatetime / endDatetime was supplied, one of them is not a real UTC calendar timestamp, or startDatetime is not earlier than endDatetime. `invalid_query`: GDELT rejected the query string as malformed — bad keyword length, unbalanced parentheses, or an illegal character. `gdelt_rate_limited`: GDELT rejected the request for its one-request-per-five-seconds limit, or too many requests were already queued for this one to start in time. `gdelt_unavailable`: GDELT DOC API is unreachable or temporarily returned no usable data. Other values are possible when a failure originates below the handler."
    • changedOutput schema / properties / error / properties / data / properties / reason / examples
      Previous value: -[
      -  "no_tone_data",
      -  "invalid_date_range",
      -  "invalid_query",
      -  "gdelt_rate_limited",
      -  "gdelt_unavailable"
      -]New value: +[
      +  "invalid_date_range",
      +  "invalid_query",
      +  "gdelt_rate_limited",
      +  "gdelt_unavailable"
      +]
    • changedOutput schema / properties / notice / description
      Previous value: -"Recovery hint when no tone data was returned. Absent on successful responses."New value: +"Guidance when no articles matched in the window — how to broaden the query or extend the window. Absent when tone data was returned."
    • changedOutput schema / properties / summary / description
      Previous value: -"Summary statistics derived from the histogram."New value: +"Summary statistics derived from the histogram. Each value is omitted when the histogram cannot support it — all of them on an empty result."
    • changedOutput schema / properties / summary / properties / neutralPct / description
      Previous value: -"Percentage of articles in the near-neutral range (bins -2 to +2)."New value: +"Percentage of articles in the near-neutral range (bins -2 to +2). Omitted when the histogram counts no articles."
    • changedOutput schema / properties / summary / properties / peakNegativeBin / description
      Previous value: -"Tone bin with the highest count among negative bins (bin < 0)."New value: +"Tone bin with the highest count among negative bins (bin < 0). Omitted when no negative bin was returned."
    • changedOutput schema / properties / summary / properties / peakPositiveBin / description
      Previous value: -"Tone bin with the highest count among positive bins (bin > 0)."New value: +"Tone bin with the highest count among positive bins (bin > 0). Omitted when no positive bin was returned."
    • removedOutput schema / properties / summary / required
      Removed value: -[
      -  "peakNegativeBin",
      -  "peakPositiveBin",
      -  "neutralPct"
      -]
  4. Changed1 schema field changed
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `no_tone_data`: No tone histogram data returned for the query. `invalid_date_range`: Exactly one of startDatetime / endDatetime was supplied. `invalid_query`: GDELT rejected the query string as malformed — bad keyword length, unbalanced parentheses, or an illegal character. `gdelt_rate_limited`: GDELT rejected the request for its one-request-per-five-seconds limit, or too many requests were already queued for this one to start in time. `gdelt_unavailable`: GDELT DOC API is unreachable or temporarily returned no usable data. Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `no_tone_data`: No tone histogram data returned for the query. `invalid_date_range`: Only one of startDatetime / endDatetime was supplied, one of them is not a real UTC calendar timestamp, or startDatetime is not earlier than endDatetime. `invalid_query`: GDELT rejected the query string as malformed — bad keyword length, unbalanced parentheses, or an illegal character. `gdelt_rate_limited`: GDELT rejected the request for its one-request-per-five-seconds limit, or too many requests were already queued for this one to start in time. `gdelt_unavailable`: GDELT DOC API is unreachable or temporarily returned no usable data. Other values are possible when a failure originates below the handler."
  5. Changed1 schema field changed
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `no_tone_data`: No tone histogram data returned for the query. `invalid_date_range`: Exactly one of startDatetime / endDatetime was supplied. `invalid_query`: GDELT rejected the query string as malformed — bad keyword length, unbalanced parentheses, or an illegal character. `gdelt_rate_limited`: GDELT rejected the request because its one-request-per-five-seconds limit was reached. `gdelt_unavailable`: GDELT DOC API is unreachable or temporarily returned no usable data. Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `no_tone_data`: No tone histogram data returned for the query. `invalid_date_range`: Exactly one of startDatetime / endDatetime was supplied. `invalid_query`: GDELT rejected the query string as malformed — bad keyword length, unbalanced parentheses, or an illegal character. `gdelt_rate_limited`: GDELT rejected the request for its one-request-per-five-seconds limit, or too many requests were already queued for this one to start in time. `gdelt_unavailable`: GDELT DOC API is unreachable or temporarily returned no usable data. Other values are possible when a failure originates below the handler."
  6. Changed3 schema fields changed
    • changedInput schema / properties / timespan / description
      Previous value: -"Time window relative to now, e.g. \"24h\", \"7d\", \"1m\". Ignored when startDatetime/endDatetime are set. Maximum 3 months."New value: +"Time window relative to now, minimum \"15min\"; other examples: \"24h\", \"7d\", \"1m\". Ignored when startDatetime/endDatetime are set. Maximum 3 months."
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `no_tone_data`: No tone histogram data returned for the query. `invalid_date_range`: Exactly one of startDatetime / endDatetime was supplied. `invalid_query`: GDELT rejected the query string as malformed — bad keyword length, unbalanced parentheses, or an illegal character. `gdelt_unavailable`: GDELT DOC API is unreachable or rate-limited. Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `no_tone_data`: No tone histogram data returned for the query. `invalid_date_range`: Exactly one of startDatetime / endDatetime was supplied. `invalid_query`: GDELT rejected the query string as malformed — bad keyword length, unbalanced parentheses, or an illegal character. `gdelt_rate_limited`: GDELT rejected the request because its one-request-per-five-seconds limit was reached. `gdelt_unavailable`: GDELT DOC API is unreachable or temporarily returned no usable data. Other values are possible when a failure originates below the handler."
    • changedOutput schema / properties / error / properties / data / properties / reason / examples
      Previous value: -[
      -  "no_tone_data",
      -  "invalid_date_range",
      -  "invalid_query",
      -  "gdelt_unavailable"
      -]New value: +[
      +  "no_tone_data",
      +  "invalid_date_range",
      +  "invalid_query",
      +  "gdelt_rate_limited",
      +  "gdelt_unavailable"
      +]
  7. Changed6 schema fields changed
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • addedInput schema / additionalProperties
      Added value: +false
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • addedOutput schema / anyOf
      Added value: +[
      +  {
      +    "not": {
      +      "required": [
      +        "error"
      +      ]
      +    },
      +    "required": [
      +      "histogram",
      +      "summary",
      +      "effectiveQuery",
      +      "totalCount"
      +    ]
      +  },
      +  {
      +    "required": [
      +      "error"
      +    ]
      +  }
      +]
    • addedOutput schema / properties / error
      Added value: +{
      +  "additionalProperties": {},
      +  "description": "Present when the call failed. Absent on success.",
      +  "properties": {
      +    "code": {
      +      "description": "JSON-RPC error code for this failure.",
      +      "maximum": 9007199254740991,
      +      "minimum": -9007199254740991,
      +      "type": "integer"
      +    },
      +    "data": {
      +      "additionalProperties": {},
      +      "properties": {
      +        "reason": {
      +          "description": "Machine-readable failure mode. Declared by this tool: `no_tone_data`: No tone histogram data returned for the query. `invalid_date_range`: Exactly one of startDatetime / endDatetime was supplied. `invalid_query`: GDELT rejected the query string as malformed — bad keyword length, unbalanced parentheses, or an illegal character. `gdelt_unavailable`: GDELT DOC API is unreachable or rate-limited. Other values are possible when a failure originates below the handler.",
      +          "examples": [
      +            "no_tone_data",
      +            "invalid_date_range",
      +            "invalid_query",
      +            "gdelt_unavailable"
      +          ],
      +          "type": "string"
      +        },
      +        "recovery": {
      +          "additionalProperties": {},
      +          "description": "Actionable next step for the caller.",
      +          "properties": {
      +            "hint": {
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "hint"
      +          ],
      +          "type": "object"
      +        },
      +        "retryable": {
      +          "description": "Whether retrying may succeed.",
      +          "type": "boolean"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "message": {
      +      "description": "Human-readable description of what went wrong.",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "code",
      +    "message"
      +  ],
      +  "type": "object"
      +}
    • removedOutput schema / required
      Removed value: -[
      -  "histogram",
      -  "summary",
      -  "effectiveQuery",
      -  "totalCount"
      -]
  8. Changed4 schema fields changed
    • changedInput schema / properties / endDatetime / description
      Previous value: -"End datetime in GDELT format YYYYMMDDHHMMSS. Must pair with startDatetime."New value: +"End datetime in GDELT format YYYYMMDDHHMMSS — exactly 14 digits, no separators (e.g. 20240131235959). Must pair with startDatetime; supplying only one of the two is rejected."
    • addedInput schema / properties / endDatetime / pattern
      Added value: +"^\\d{14}$"
    • changedInput schema / properties / startDatetime / description
      Previous value: -"Start datetime in GDELT format YYYYMMDDHHMMSS. Must pair with endDatetime."New value: +"Start datetime in GDELT format YYYYMMDDHHMMSS — exactly 14 digits, no separators (e.g. 20240101000000). Must pair with endDatetime; supplying only one of the two is rejected."
    • addedInput schema / properties / startDatetime / pattern
      Added value: +"^\\d{14}$"
  9. Changed2 schema fields changed
    • addedOutput schema / properties / endDatetime
      Added value: +{
      +  "description": "Echoed end datetime when provided (YYYYMMDDHHMMSS).",
      +  "type": "string"
      +}
    • addedOutput schema / properties / startDatetime
      Added value: +{
      +  "description": "Echoed start datetime when provided (YYYYMMDDHHMMSS).",
      +  "type": "string"
      +}
  10. Changed5 schema fields changed
    • addedOutput schema / properties / effectiveQuery
      Added value: +{
      +  "description": "Echoed query string for use in follow-up calls.",
      +  "type": "string"
      +}
    • changedOutput schema / properties / notice / description
      Previous value: -"Recovery hint when no data was returned. Absent on successful responses."New value: +"Recovery hint when no tone data was returned. Absent on successful responses."
    • removedOutput schema / properties / query
      Removed value: -{
      -  "description": "Echoed query string.",
      -  "type": "string"
      -}
    • addedOutput schema / properties / totalCount
      Added value: +{
      +  "description": "Total number of articles across all histogram bins.",
      +  "type": "number"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "query",
      -  "histogram",
      -  "summary"
      -]New value: +[
      +  "histogram",
      +  "summary",
      +  "effectiveQuery",
      +  "totalCount"
      +]
  11. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations only declare readOnlyHint/openWorldHint, so the description carries the real behavioral burden and does so well: it discloses the size budget, that a response returns whole bins only, and the nextOffset/offset paging protocol with 'otherwise identical inputs'. It also explains the default-vs-bins response difference (first 3 links vs every link) and that unmatched bins are rejected rather than ignored. It stops short of auth or rate-limit context, but the pagination and response-shaping behavior is unusually well covered.

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?

Front-loads the core purpose and the differentiator, then layers on paging and the sibling comparison. Every sentence carries information, though the response-shape details make it denser than necessary for a 6-parameter tool.

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?

An output schema exists so return values need not be explained, yet the description still covers paging continuation and bin selection, which is what an agent needs to complete a multi-call workflow. The sibling routing is likewise complete; only minor operational context (e.g. when a query is too broad) is absent.

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 all six parameters are already documented in the schema, including bins, offset, and the datetime pairing rule. The description restates the offset pass-back pattern and the bins behavior without adding format or syntax beyond what the schema supplies — baseline 3 is appropriate.

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?

States a specific verb+resource (tonal distribution of matching articles as a histogram) and immediately explains the analytical value over a single average tone score. It explicitly distinguishes itself from the sibling gdelt_get_coverage_timeline (mode: tone), so an agent can pick correctly without opening either schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives both the when-to-use case (snapshot distribution across all matching articles) and the named alternative with the condition that selects it ('Use gdelt_get_coverage_timeline with mode "tone" to see how sentiment shifted over time'). Nothing is left to inference.

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.