Skip to content
🔑 DPX is in private beta. Settlement execution requires approval — request access. All other APIs are live and free to use in sandbox mode.

LangChain — Python Tools

The DPX LangChain tools let any Python agent price settlements, check stability, and retrieve ESG scores using the standard @tool decorator pattern.

Terminal window
pip install langchain langchain-openai httpx
/Users/victoriacase/Documents/GitHub/dpx-protocol/dpx-agents/langchain_tools.py
ToolDescription
dpx_get_manifestProtocol capabilities and contract addresses
dpx_get_quoteFull fee breakdown for a settlement
dpx_get_esg_scoreLive E, S, G scores
dpx_get_reliabilityStability signals
dpx_verify_feesOn-chain fee verification
dpx_get_fee_scheduleComplete fee table
dpx_compare_feesDPX vs Stripe, Wise, SWIFT
from langchain_tools import dpx_tools
from langchain_openai import ChatOpenAI
from langchain.agents import create_tool_calling_agent, AgentExecutor
llm = ChatOpenAI(model="gpt-4o")
agent = create_tool_calling_agent(llm, dpx_tools, prompt)
executor = AgentExecutor(agent=agent, tools=dpx_tools)
result = executor.invoke({
"input": "Price a $2M cross-border settlement with ESG score 75"
})

For production LangChain deployments, use the MCP adapter instead of direct HTTP tools. This gives you automatic schema updates whenever the protocol changes.

from langchain_mcp_adapters.client import MultiServerMCPClient
client = MultiServerMCPClient({
"dpx": {
"command": "node",
"args": ["/path/to/dpx-mcp/index.js"],
"transport": "stdio"
}
})
tools = await client.get_tools()
Terminal window
STABILITY_ORACLE_URL=http://localhost:3000
ESG_ORACLE_URL=http://localhost:3001

Beta partners: Replace the localhost URLs with the production endpoints provided upon approval.