FXMacroData for the OpenAI Agents SDK
Give an OpenAI Agents SDK agent every public FXMacroData operation as a function
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 FunctionTool whose name,
description and parameter schema come straight from the public operation
catalogue, so the model sees the same contract the documentation describes.
Install
Install the openai-agents-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 ./openai-agents-fxmacrodata
Use with an agent
from agents import Agent, Runner
from openai_agents_fxmacrodata import tools
agent = Agent(
name="Macro analyst",
instructions="Answer with the official release values and cite the source_url.",
tools=tools(
api_key_env="FXMD_API_KEY",
include=["indicator_history", "release_calendar", "latest_announcements"],
),
)
result = Runner.run_sync(agent, "What is the latest US policy rate decision?")
print(result.final_output)
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. The tools are built with strict_json_schema=False because
several operations have optional parameters; the parameter schema itself
forbids unknown keys and every call is validated before it is sent.
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 with a short error
message. 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 a compact JSON string with operation, source_url,
record_count, the first max_records records (default 200) and a truncated
flag. 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 return {"error": "..."} 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 openai_agents_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=openai-agents-fxmacrodata&utm_content=readme
Development
Run the offline tests with python -m pytest tests. They build the tools,
invoke them against fixture responses and never call the live service.
Metadata
Release files for openai-agents-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)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| openai_agents_fxmacrodata-0.1.0.tar.gz | 9.6 kB | Without provenance | Details for openai_agents_fxmacrodata-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| openai_agents_fxmacrodata-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for openai_agents_fxmacrodata-0.1.0-py3-none-any.whl |
Total release size: 17.5 kB
Release files / openai_agents_fxmacrodata-0.1.0.tar.gz
| Download URL | openai_agents_fxmacrodata-0.1.0.tar.gz |
|---|---|
| Size | 9.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0f7d663365783f3e81998aef8654b429fd86a648b9db5907242dcad5e70f2a61
|
|
BLAKE2b-256 checksum How to use checksums |
16c0fee900f3a8034eeef2c358a6f4f563d45f7eeb96d3c01b055312c2561c37
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
FXMacroData-PackagePublisher/1.0
|
Release files / openai_agents_fxmacrodata-0.1.0-py3-none-any.whl
| Download URL | openai_agents_fxmacrodata-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
44a1c882f692b47d71e9386053847edd3ad5f486cd60772e07c75a7543d5b044
|
|
BLAKE2b-256 checksum How to use checksums |
02607aa519f620b46125188a5a52a5e010cd422b0b03564a1eaa1d26d281d89f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
FXMacroData-PackagePublisher/1.0
|
Security for openai-agents-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.