Free API key
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
Query any FRED series ID
Series frequencies and revision schedules differ; never let the agent compare unaligned observations.
Federal Reserve Bank of St. Louis · macro
Build the tool server
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
Track the inflation and rate regime
- Sourced evidence
- Repeatable steps
- Explicit uncertainty
Compare labor series on aligned dates
- Sourced evidence
- Repeatable steps
- Explicit uncertainty
Build a sourced macro briefing
- Sourced evidence
- Repeatable steps
- Explicit uncertainty
Access requirements
FRED_API_KEY
Review source and upstream data licenses
Use caching, backoff and bounded concurrency
Connect to your Agent
{
"mcpServers": {
"fred-agent": {
"command": "python",
"args": [
"server.py"
],
"env": {
"FRED_API_KEY": "YOUR_KEY"
}
}
}
}“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
{
"mcpServers": {
"fred-agent": {
"command": "python",
"args": [
"server.py"
],
"env": {
"FRED_API_KEY": "YOUR_KEY"
}
}
}
}“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 documentationProject-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.