Macroeconomic data

FRED Macro Agent Skill

Let an agent retrieve macro time series for rates, inflation, employment and liquidity research.

Source
Federal Reserve Bank of St. Louis
Access
Free API key

What this adds to your agent

Query any FRED series ID

Control date ranges and observation limits

Return source dates with every value

Implementation statusGuide reviewed · 2026-07
Implementation status

Free API key

Expected result

Query any FRED series ID

Known failure mode

Series frequencies and revision schedules differ; never let the agent compare unaligned observations.

Compatibility

Federal Reserve Bank of St. Louis · macro

Build the tool server

server.py
from mcp.server.fastmcp import FastMCP
import os, requests

mcp = FastMCP("FRED Macro")

@mcp.tool()
def fred_series(series_id: str, limit: int = 24) -> list:
    """Return recent observations for a FRED series."""
    params = {"series_id": series_id, "api_key": os.environ["FRED_API_KEY"],
              "file_type": "json", "sort_order": "desc", "limit": limit}
    data = requests.get("https://api.stlouisfed.org/fred/series/observations",
                        params=params, timeout=20).json()
    return data["observations"]

if __name__ == "__main__": mcp.run()

Examples and expected outcomes

Example 1

Track the inflation and rate regime

  • Sourced evidence
  • Repeatable steps
  • Explicit uncertainty
Example 2

Compare labor series on aligned dates

  • Sourced evidence
  • Repeatable steps
  • Explicit uncertainty
Example 3

Build a sourced macro briefing

  • Sourced evidence
  • Repeatable steps
  • Explicit uncertainty

Access requirements

Keys and runtime

FRED_API_KEY

License and data rights

Review source and upstream data licenses

Rate limits

Use caching, backoff and bounded concurrency

Connect to your Agent

Claude config
{
  "mcpServers": {
    "fred-agent": {
      "command": "python",
      "args": [
        "server.py"
      ],
      "env": {
        "FRED_API_KEY": "YOUR_KEY"
      }
    }
  }
}
Prompt example

“Use FRED Macro Agent Skill to research AAPL. List sources and timestamps first, then separate facts, calculations, risks and missing data. Do not give personalized trading advice.”

When not to use it

  • Series frequencies and revision schedules differ; never let the agent compare unaligned observations.

Connect it to your agent

Claude Desktop
{
  "mcpServers": {
    "fred-agent": {
      "command": "python",
      "args": [
        "server.py"
      ],
      "env": {
        "FRED_API_KEY": "YOUR_KEY"
      }
    }
  }
}
Prompt to test

“Use the connected tool to research AAPL. State the source and timestamp for every factual claim, separate facts from interpretation, and do not give personalized financial advice.”

Production checklist

  • Keep secrets outside prompts and source code
  • Allowlist read-only tools first
  • Log tool inputs, outputs and source timestamps
  • Require citations and handle missing data explicitly

When not to use it

Series frequencies and revision schedules differ; never let the agent compare unaligned observations.

Open official documentation

Project-specific questions

What can FRED Macro Agent Skill do in a real workflow?

Query any FRED series ID Control date ranges and observation limits Return source dates with every value

What access and compatibility does FRED Macro Agent Skill require?

Free API key. Federal Reserve Bank of St. Louis.

What is the main implementation risk with FRED Macro Agent Skill?

Series frequencies and revision schedules differ; never let the agent compare unaligned observations.