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 includes representative article URLs. 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
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).
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. Absent when tone data was returned.
summaryNoSummary statistics derived from the histogram. Each value is omitted when the histogram cannot support it — all of them on an empty result.
histogramNoTone histogram sorted from most negative to most positive bin.
totalCountNoTotal number of articles across all histogram bins.
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. 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)."
  2. 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"
      -]
  3. 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."
  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 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."
  5. 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"
      +]
  6. 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"
      -]
  7. 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}$"
  8. 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"
      +}
  9. 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"
      +]
  10. First observed

TDQS

A4.7/5.0
Behavior4/5

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

Annotations already declare readOnlyHint and openWorldHint. The description adds behavioral context: the histogram bin range (~-30 to +30), that bins include representative article URLs, and that it is a snapshot rather than a time series. This goes beyond the annotations and helps the agent understand the shape of the response. A slight gap is not describing any pagination or volume limits, but given the output schema exists, this is adequate.

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 well-structured and front-loaded: it states the core function first, then explains the added value of a histogram, then differentiates from the sibling and gives a usage directive. Every sentence contributes meaning; no filler or repetition. It is concise for the information it conveys.

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

Completeness5/5

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

With an output schema present, the description does not need to explain return values. It covers the query syntax, time constraints, and differentiation from the timeline tool. All necessary information for correct invocation is present, and the description addresses the main usage decision an agent must make.

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

Parameters4/5

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

Schema coverage is 100%, so the schema already documents all parameters well. The description adds value by referencing the query syntax of gdelt_search_articles and mentioning that timespan is ignored when start/end datetime are set. This supplements the schema without redundancy, earning a score above the baseline.

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 returns a tonal distribution histogram for articles matching a query, and explicitly contrasts it with a single average tone score and with the timeline sibling. It specifies the resource (articles) and the output format (histogram with bins and representative URLs), making the purpose unmistakable.

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?

It explicitly names the sibling tool gdelt_get_coverage_timeline and explains when to use it instead: to see sentiment over time, versus this snapshot distribution. It also clarifies that the query syntax follows gdelt_search_articles, giving the agent direct guidance on parameter construction.

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.