Skip to main content
Glama
Finance Toolkit

Finance Toolkit

government

Read-onlyIdempotent

Retrieve fiscal metrics by country—debt, deficit, expenditure, revenue, tax, interest, COFOG spending and public trust—to compare public finances over time.

Instructions

Government fiscal metrics by country (debt, deficit, expenditure, revenue, tax revenue, interest expenditure, expenditure by function, trust in government). Requires countries='United States' — use comma-separated values for multiple countries. Do NOT use tickers= for this tool. Supports start_date/end_date. Debt, deficit, expenditure, revenue and tax revenue are yearly (Global Macro Database, millions of national currency); level='consolidated' (default, longest history), 'general' (general government) or 'central' (central government) selects their level of government. Interest expenditure (IMF, general government interest payable, accrual basis, before interest received; around 40 economies incl. the United States, the euro area countries, the United Kingdom, Canada, Australia and Brazil, not Japan or China) comes quarterly unless period='yearly': get_government_interest_expenditure in millions of national currency, get_government_interest_expenditure_to_gdp_ratio and get_government_interest_expenditure_to_revenue_ratio as decimals, quarterly ratios over the last four quarters. Expenditure by function (IMF COFOG, general government, yearly, around 180 countries, latest year usually one or two years back): get_government_expenditure_by_function (millions of national currency) and get_government_expenditure_by_function_to_gdp_ratio (decimals), columns per country and function; functions= picks 'General Public Services', 'Defence', 'Public Order and Safety', 'Economic Affairs', 'Environmental Protection', 'Housing and Community Amenities', 'Health', 'Recreation, Culture and Religion', 'Education', 'Social Protection' (the ten divisions, the default), 'Public Debt Transactions' (COFOG 01.7, mostly interest, also for countries without interest expenditure) or 'Total', comma-separated. Interest against defence, both shares of the same GDP: get_government_interest_expenditure_to_gdp_ratio with period='yearly' next to get_government_expenditure_by_function_to_gdp_ratio with functions='Defence'. Ratios are decimal fractions (0.04 is 4% of GDP). Supports rolling=N (moving-average smoothing) and trailing=N (trailing N-period sum, e.g. a trailing-4-quarter sum) on the raw series.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "indicator": "<indicator>"
    },
    "name": "government"
  }
}

Input Schema

NameRequiredDescriptionDefault
lagNoNumber of periods to lag when computing growth rates.
rankNotrue ranks the tickers (or countries) within every period, from the highest value (rank 1) to the lowest, and compares each with its neighbour toward the middle of the ranking: the Difference (in points for returns) and the Multiple (only when both have the same sign), so the first and last rank show how far the best and the worst stand apart, e.g. a fall more than twice as large as the next one. Needs a value per period and ticker; pick one field with show_columns where there are more.
levelNoLevel of government: 'consolidated' (longest history), 'general' (central, state and local government and social security) or 'central'.consolidated
limitNoThe rows to return, like head and tail: 5 for the first five, -5 for the last five (the most recent of a time series). A table with its periods as columns (financial statements, ratios) keeps its first or last periods instead, and rows per ticker (an earnings calendar) are selected per ticker. For ETF holdings the largest (or, negative, the smallest) by weight, and for a list (e.g. news or a screener) its length. 0 returns every row.
growthNoReturn period-over-period growth rates instead of absolute values.
periodNoObservation frequency, e.g. 'daily', 'weekly', 'monthly', 'quarterly', or 'annual' (supported values differ per method).
rollingNoRolling window size in number of periods. When set, the metric is computed over a smoothly overlapping trailing window across the full history (e.g. period='monthly' and rolling=6 gives a rolling 6-month value) instead of one value per period, or (for economics indicators) a simple moving average used to smooth the raw series.
end_dateNoEnd of the date range in YYYY-MM-DD format; left empty, today (or the indicator's own window).
trailingNoTrailing window size in number of periods. Sums the raw values over the trailing N periods (e.g. trailing=4 on quarterly data gives a trailing-4-quarter / TTM-style sum) instead of returning one value per period.
countriesNoCountry names, comma-separated or as a list, e.g. 'United States,Germany,Japan'.
functionsNoFunctions of government (COFOG), comma-separated, e.g. 'Defence,Health,Education'; 'Public Debt Transactions' or 'Total' also work. Defaults to the ten divisions.
indicatorYesName of the specific metric to calculate, one of the listed values. Required — search_metrics finds the indicator (and its tool) for a metric by name.
quarterlyNoReturn quarterly data instead of annual when True.
start_dateNoStart of the date range in YYYY-MM-DD format; left empty, five years before today (or the indicator's own window).
standardizeNoReturn the Z-Score (standard score) instead of the raw values, i.e. how many standard deviations each value is from the mean of its own series. When combined with growth=True, the growth values are standardized instead of the raw values.
show_columnsNoComma-separated names to filter the output. For historical data use the key names visible in any response record (e.g. 'Close,Volume,Return'). For financial statements use the 'metric' field values from the response (e.g. 'Revenue,Net Income,EBITDA'). Call the tool once without this parameter to see all available names, then repeat with show_columns to reduce response size and token usage.
gmdb_forecastsNoSet to true to include the years the Global Macro Database projects (IMF World Economic Outlook, up to five years ahead); by default a yearly series ends with its last observation.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv2.3.4
    • addedInput schema / properties / functions
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Functions of government (COFOG), comma-separated, e.g. 'Defence,Health,Education'; 'Public Debt Transactions' or 'Total' also work. Defaults to the ten divisions."
      +}
    • changedInput schema / properties / indicator / enum
      Previous value: -[
      -  "get_government_debt",
      -  "get_government_debt_to_gdp_ratio",
      -  "get_government_deficit",
      -  "get_government_deficit_to_gdp_ratio",
      -  "get_government_expenditure",
      -  "get_government_expenditure_to_gdp_ratio",
      -  "get_government_revenue",
      -  "get_government_revenue_to_gdp_ratio",
      -  "get_government_tax_revenue",
      -  "get_government_tax_revenue_to_gdp_ratio",
      -  "get_trust_in_government"
      -]New value: +[
      +  "get_government_debt",
      +  "get_government_debt_to_gdp_ratio",
      +  "get_government_deficit",
      +  "get_government_deficit_to_gdp_ratio",
      +  "get_government_expenditure",
      +  "get_government_expenditure_to_gdp_ratio",
      +  "get_government_revenue",
      +  "get_government_revenue_to_gdp_ratio",
      +  "get_government_tax_revenue",
      +  "get_government_tax_revenue_to_gdp_ratio",
      +  "get_government_interest_expenditure",
      +  "get_government_interest_expenditure_to_gdp_ratio",
      +  "get_government_interest_expenditure_to_revenue_ratio",
      +  "get_government_expenditure_by_function",
      +  "get_government_expenditure_by_function_to_gdp_ratio",
      +  "get_trust_in_government"
      +]
    • addedInput schema / properties / period
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Observation frequency, e.g. 'daily', 'weekly', 'monthly', 'quarterly', or 'annual' (supported values differ per method)."
      +}
    • addedInput schema / properties / rank
      Added value: +{
      +  "default": false,
      +  "description": "true ranks the tickers (or countries) within every period, from the highest value (rank 1) to the lowest, and compares each with its neighbour toward the middle of the ranking: the Difference (in points for returns) and the Multiple (only when both have the same sign), so the first and last rank show how far the best and the worst stand apart, e.g. a fall more than twice as large as the next one. Needs a value per period and ticker; pick one field with show_columns where there are more.",
      +  "type": "boolean"
      +}
  2. Changed1 schema field changedv2.3.2
    • changedInput schema / properties / limit / description
      Previous value: -"The rows to return, like head and tail: 5 for the first five, -5 for the last five (the most recent of a time series). A table with its periods as columns (financial statements, ratios) keeps its first or last periods instead. For ETF holdings the largest (or, negative, the smallest) by weight, and for a list (e.g. news or a screener) its length. 0 returns every row."New value: +"The rows to return, like head and tail: 5 for the first five, -5 for the last five (the most recent of a time series). A table with its periods as columns (financial statements, ratios) keeps its first or last periods instead, and rows per ticker (an earnings calendar) are selected per ticker. For ETF holdings the largest (or, negative, the smallest) by weight, and for a list (e.g. news or a screener) its length. 0 returns every row."
  3. Changed5 schema fields changedv2.3.1
    • changedInput schema / properties / end_date / default
      Previous value: -"2026-10-27"New value: +""
    • changedInput schema / properties / end_date / description
      Previous value: -"End of the date range in YYYY-MM-DD format."New value: +"End of the date range in YYYY-MM-DD format; left empty, today (or the indicator's own window)."
    • changedInput schema / properties / limit / description
      Previous value: -"The rows to return, like head and tail: 5 for the first five, -5 for the last five (the most recent of a time series). A table with its periods as columns (financial statements, ratios) keeps its first or last periods instead. For ETF holdings the largest (or, negative, the smallest) by weight, and for a list (e.g. news or a screener) its length."New value: +"The rows to return, like head and tail: 5 for the first five, -5 for the last five (the most recent of a time series). A table with its periods as columns (financial statements, ratios) keeps its first or last periods instead. For ETF holdings the largest (or, negative, the smallest) by weight, and for a list (e.g. news or a screener) its length. 0 returns every row."
    • changedInput schema / properties / start_date / default
      Previous value: -"2021-10-28"New value: +""
    • changedInput schema / properties / start_date / description
      Previous value: -"Start of the date range in YYYY-MM-DD format."New value: +"Start of the date range in YYYY-MM-DD format; left empty, five years before today (or the indicator's own window)."
  4. Changed2 schema fields changedv2.3.0
    • changedInput schema / properties / end_date / default
      Previous value: -"2026-10-14"New value: +"2026-10-27"
    • changedInput schema / properties / start_date / default
      Previous value: -"2021-10-15"New value: +"2021-10-28"
  5. Changed21 schema fields changedv2.2.3
    • addedInput schema / properties / countries / anyOf
      Added value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "items": {
      +      "type": "string"
      +    },
      +    "type": "array"
      +  }
      +]
    • changedInput schema / properties / countries / description
      Previous value: -"Comma-separated country names, e.g. 'United States,Germany,Japan'."New value: +"Country names, comma-separated or as a list, e.g. 'United States,Germany,Japan'."
    • removedInput schema / properties / countries / title
      Removed value: -"Countries"
    • removedInput schema / properties / countries / type
      Removed value: -"string"
    • changedInput schema / properties / end_date / default
      Previous value: -"2026-10-02"New value: +"2026-10-14"
    • removedInput schema / properties / end_date / title
      Removed value: -"End Date"
    • addedInput schema / properties / gmdb_forecasts
      Added value: +{
      +  "default": false,
      +  "description": "Set to true to include the years the Global Macro Database projects (IMF World Economic Outlook, up to five years ahead); by default a yearly series ends with its last observation.",
      +  "type": "boolean"
      +}
    • removedInput schema / properties / growth / title
      Removed value: -"Growth"
    • changedInput schema / properties / indicator / description
      Previous value: -"Name of the specific metric to calculate, e.g. 'get_asset_turnover_ratio'. Required — omitting it returns the list of available indicators."New value: +"Name of the specific metric to calculate, one of the listed values. Required — search_metrics finds the indicator (and its tool) for a metric by name."
    • removedInput schema / properties / indicator / title
      Removed value: -"Indicator"
    • removedInput schema / properties / lag / title
      Removed value: -"Lag"
    • addedInput schema / properties / level
      Added value: +{
      +  "default": "consolidated",
      +  "description": "Level of government: 'consolidated' (longest history), 'general' (central, state and local government and social security) or 'central'.",
      +  "type": "string"
      +}
    • addedInput schema / properties / limit
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "The rows to return, like head and tail: 5 for the first five, -5 for the last five (the most recent of a time series). A table with its periods as columns (financial statements, ratios) keeps its first or last periods instead. For ETF holdings the largest (or, negative, the smallest) by weight, and for a list (e.g. news or a screener) its length."
      +}
    • removedInput schema / properties / quarterly / title
      Removed value: -"Quarterly"
    • removedInput schema / properties / rolling / title
      Removed value: -"Rolling"
    • removedInput schema / properties / show_columns / title
      Removed value: -"Show Columns"
    • removedInput schema / properties / standardize / title
      Removed value: -"Standardize"
    • changedInput schema / properties / start_date / default
      Previous value: -"2021-10-03"New value: +"2021-10-15"
    • removedInput schema / properties / start_date / title
      Removed value: -"Start Date"
    • removedInput schema / properties / trailing / title
      Removed value: -"Trailing"
    • removedInput schema / title
      Removed value: -"governmentArguments"
  6. Changed2 schema fields changedv2.2.1
    • changedInput schema / properties / end_date / default
      Previous value: -"2026-08-19"New value: +"2026-10-02"
    • changedInput schema / properties / start_date / default
      Previous value: -"2021-08-20"New value: +"2021-10-03"
  7. Changed2 schema fields changedv2.2.0
    • changedInput schema / properties / end_date / default
      Previous value: -"2026-07-14"New value: +"2026-08-19"
    • changedInput schema / properties / start_date / default
      Previous value: -"2021-07-15"New value: +"2021-08-20"
  8. Changed5 schema fields changed
    • changedInput schema / properties / end_date / default
      Previous value: -"2026-07-09"New value: +"2026-07-14"
    • addedInput schema / properties / rolling
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Rolling window size in number of periods. When set, the metric is computed over a smoothly overlapping trailing window across the full history (e.g. period='monthly' and rolling=6 gives a rolling 6-month value) instead of one value per period, or (for economics indicators) a simple moving average used to smooth the raw series.",
      +  "title": "Rolling"
      +}
    • addedInput schema / properties / standardize
      Added value: +{
      +  "default": false,
      +  "description": "Return the Z-Score (standard score) instead of the raw values, i.e. how many standard deviations each value is from the mean of its own series. When combined with growth=True, the growth values are standardized instead of the raw values.",
      +  "title": "Standardize",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / start_date / default
      Previous value: -"2021-07-10"New value: +"2021-07-15"
    • addedInput schema / properties / trailing
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Trailing window size in number of periods. Sums the raw values over the trailing N periods (e.g. trailing=4 on quarterly data gives a trailing-4-quarter / TTM-style sum) instead of returning one value per period.",
      +  "title": "Trailing"
      +}
  9. Changed2 schema fields changedv2.1.4
    • changedInput schema / properties / end_date / default
      Previous value: -"2026-06-27"New value: +"2026-07-09"
    • changedInput schema / properties / start_date / default
      Previous value: -"2021-06-28"New value: +"2021-07-10"
  10. Changed2 schema fields changedv2.1.3
    • changedInput schema / properties / end_date / default
      Previous value: -"2026-06-23"New value: +"2026-06-27"
    • changedInput schema / properties / start_date / default
      Previous value: -"2021-06-24"New value: +"2021-06-28"
  11. Changed4 schema fields changedv0.1.2
    • changedInput schema / properties / end_date / default
      Previous value: -"2026-06-22"New value: +"2026-06-23"
    • removedInput schema / properties / rounding
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "integer"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "description": "Number of decimal places to round results to.",
      -  "title": "Rounding"
      -}
    • addedInput schema / properties / show_columns
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Comma-separated names to filter the output. For historical data use the key names visible in any response record (e.g. 'Close,Volume,Return'). For financial statements use the 'metric' field values from the response (e.g. 'Revenue,Net Income,EBITDA'). Call the tool once without this parameter to see all available names, then repeat with show_columns to reduce response size and token usage.",
      +  "title": "Show Columns"
      +}
    • changedInput schema / properties / start_date / default
      Previous value: -"2021-06-23"New value: +"2021-06-24"
  12. Addedv0.1.1

TDQS

A4.4/5.0
Behavior5/5

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

Annotations already declare readOnlyHint, idempotentHint and openWorldHint, so the safety profile is settled; the description goes far beyond by disclosing data sources (Global Macro Database, IMF COFOG), units (millions of national currency), ratio encoding (decimals, 0.04 = 4%), and frequency per metric. It also warns about real-world limitations an agent could otherwise misread as failures, such as interest expenditure not covering Japan or China and expenditure-by-function lagging one or two years behind the latest year.

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

Conciseness3/5

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

It is front-loaded well, starting with purpose and the mandatory country requirement before drilling into per-indicator detail. However, the bulk arrives as one dense unbroken paragraph with no segmentation, so the reader must parse source, frequency, units and coverage caveats for eight different metrics out of a single block; some of that detail (e.g. the interest-versus-defence comparison recipe) reads as workflow instruction rather than definition.

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 no explanation, and the description is otherwise complete for a sixteen-indicator tool: units, frequencies, coverage, ratio encoding and lag are all covered. The one omission is trust in government, which is named in the opening list but given no source, frequency or coverage detail anywhere in the rest of the text.

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 baseline would be 3, but the description adds indicator-specific behavior the schema cannot express: which indicators are yearly, which come quarterly unless period='yearly', what level='consolidated'/'general'/'central' actually selects, and how functions= maps to COFOG divisions including the 'Public Debt Transactions' fallback for countries without interest data. It also restates rolling= and trailing= in domain terms (moving-average smoothing, trailing-4-quarter sums) that clarify intent beyond the generic schema wording.

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 opens with a specific verb-and-resource statement ("Government fiscal metrics by country") and enumerates the exact metric families covered: debt, deficit, expenditure, revenue, tax revenue, interest expenditure, expenditure by function, and trust in government. That enumeration maps directly onto the sixteen enum values in the indicator parameter, so an agent can tell this apart from siblings like macroeconomics or rates without opening the schema.

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

Usage Guidelines4/5

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

It states hard requirements (countries='United States' is mandatory) and an explicit exclusion ("Do NOT use tickers= for this tool"), plus conditional routing such as using period='yearly' on the interest-to-GDP ratio to compare against defence spending by function. What it never does is name a sibling tool as the alternative for a related query, so the guidance stops short of full when/when-not/alternatives coverage.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.