Skip to main content

FXMacroData for AutoGen

Give an AutoGen agent every public FXMacroData operation as a tool: macroeconomic releases, central-bank decisions, release calendars, FX reference rates, commodities, positioning and research tools. Each of the 87 REST operations and MCP tools becomes one autogen_core.tools.BaseTool whose name, description and parameter schema come straight from the public operation catalogue, so the model sees the same contract the documentation describes.

Explore FXMacroData

Install

Install the autogen-fxmacrodata wheel together with its fxmacrodata-platform-core and fxmacrodata-public-client dependencies. From the supplied packages directory:

python -m pip install ./fxmacrodata-public-client ./fxmacrodata-platform-core ./autogen-fxmacrodata

autogen-agentchat supplies the AssistantAgent used below; this package depends only on autogen-core.

Use with an agent

import asyncio

from autogen_agentchat.agents import AssistantAgent
from autogen_fxmacrodata import tools

agent = AssistantAgent(
    name="macro_analyst",
    model_client=model_client,
    tools=tools(
        api_key_env="FXMD_API_KEY",
        include=["indicator_history", "release_calendar", "latest_announcements"],
    ),
    system_message="Answer with the official release values and cite the source_url.",
)
result = asyncio.run(agent.run(task="What is the latest US policy rate decision?"))
print(result.messages[-1].content)

model_client is any AutoGen chat completion client. Omit include to expose every operation, or pass exclude to drop a few. MCP tools keep their mcp_ prefix. Unknown names raise ValueError before any request is made. A single operation can also be wrapped directly with FXMacroDataTool("indicator_history").

Credentials

Set FXMD_API_KEY (or any name you prefer) in your environment or secret manager and pass its name through api_key_env. The value is read only while a tool executes; it is never stored on the tools, never placed in a tool description or schema, and never shown to the model. A tool call that tries to pass an API key, token or URL as an argument is rejected before any request is made. Omitting api_key_env selects anonymous access, which serves the USD catalogue and is enough to evaluate the tools.

Bounded tool output

Every tool returns an FXMacroDataResult with operation, source_url, record_count, the first max_records records (default 200) and a truncated flag; AutoGen renders it to the model as compact JSON. The complete response envelope is included as response while the whole document fits in max_chars (default 60,000 characters); otherwise it is omitted and records are trimmed until the document fits, so a long history can never flood a model context. Failed reads set error on the result rather than raising, so the agent can adjust its arguments and retry. Reads run in a worker thread and never block the event loop.

For the complete, unbounded response in your own code, use the plain helper:

from autogen_fxmacrodata import fetch

batch = fetch("indicator_history", {"currency": "usd", "indicator": "policy_rate"})
batch.payload      # original response envelope
batch.records()    # list of records
batch.rows()       # tabular rows with record_json and response_json

Historical operations follow every page by default (complete_history=True, max_pages=1000). Calendar and observation times keep the API's original strings; nothing is inferred.

Full operation reference: https://fxmacrodata.com/documentation/reference?utm_source=github&utm_medium=referral&utm_campaign=autogen-fxmacrodata&utm_content=readme

Development

Run the offline tests with python -m pytest tests. They build the tools, run them against fixture responses and never call the live service.

Metadata

Release files for autogen-fxmacrodata 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for autogen-fxmacrodata 0.1.0
File Size Uploaded Provenance Actions
autogen_fxmacrodata-0.1.0.tar.gz 9.9 kB Without provenance Details for autogen_fxmacrodata-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for autogen-fxmacrodata 0.1.0
File Interpreter ABI Platform Actions
autogen_fxmacrodata-0.1.0-py3-none-any.whl Python 3 none any Details for autogen_fxmacrodata-0.1.0-py3-none-any.whl

Total release size: 17.9 kB

Release files / autogen_fxmacrodata-0.1.0.tar.gz

Download URL autogen_fxmacrodata-0.1.0.tar.gz
Size 9.9 kB
Tags Source
SHA-256 checksum
How to use checksums
c7ede55edcb019a82cfe499e44bba2effe92e1c138bface223fdc56e97da3519
BLAKE2b-256 checksum
How to use checksums
5bff8fb802c0d1cc708b14aff1953cba5bd56a872424468cd385482c3dcf4b77
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via FXMacroData-PackagePublisher/1.0

Release files / autogen_fxmacrodata-0.1.0-py3-none-any.whl

Download URL autogen_fxmacrodata-0.1.0-py3-none-any.whl
Size 8.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aeb7c4cc735fc5202cca77cd42ab8ecb78962f99ae472110eda3505f509c7924
BLAKE2b-256 checksum
How to use checksums
1619a28d3796e659a7f9774a40b6d3fcc45bf4eb3374fad3cfcd4f3cd2cb2a62
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via FXMacroData-PackagePublisher/1.0

Security for autogen-fxmacrodata 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page