Looking beyond the OpenAI Agents SDK overview? This deep-dive playbook shows Python engineers exactly when to mount MCPServerStreamableHttp against https://mcp.upp3.com/mcp (alias https://upp3.com/mcp) with cache_tools_list=True and create_static_tool_filter, when to pin hot paths to deterministic @function_tool REST wrappers on https://api.upp3.com, and how to run both tracks under one X-API-Key across 16 global platforms, 56 Hosted MCP tools, and 67 REST routes.
Switch between direct REST + MCP health checks, an ast.parse()-verified Python dual-track agent combining MCPServerStreamableHttp with @function_tool, and a JSON.parse()-valid scoped client manifest. Minting a free key below auto-replaces ed_live_your_key_here across all tabs.
Using placeholder ed_live_your_key_here — claim a free 500-credit key below to auto-fill cURL, Python, and JSON tabs.Auto-Fill Free Key →
REST /v1/* + MCP Probe (cURL)
# 1) Direct REST hot-path: Amazon product search with mode=summary (-81.3% avg tokens)
curl -sS "https://api.upp3.com/v1/amazon/products/search?query=usb+c+hub&country=US&mode=summary" \
-H "X-API-Key: ed_live_your_key_here"
# 2) Direct REST batch quotes: TradingView multi-asset watchlist in a single call
curl -sS "https://api.upp3.com/v1/finance/tradingview/quotes?symbols=NASDAQ:AAPL,NASDAQ:NVDA,NASDAQ:MSFT&mode=summary" \
-H "X-API-Key: ed_live_your_key_here"
# 3) Verify Streamable HTTP Hosted MCP endpoint (56 tools; alias https://upp3.com/mcp)
curl -sS -X POST "https://mcp.upp3.com/mcp" \
-H "X-API-Key: ed_live_your_key_here" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | head -c 500
import asyncio
import os
from typing import Any
import httpx
from agents import Agent, Runner, function_tool
from agents.mcp import MCPServerStreamableHttp, create_static_tool_filter
EDGEDATA_API_KEY = os.getenv("EDGEDATA_API_KEY", "ed_live_your_key_here")
REST_BASE_URL = "https://api.upp3.com"
MCP_ENDPOINT = "https://mcp.upp3.com/mcp" # alias: https://upp3.com/mcp
# Deterministic REST hot path: pinned mode="summary" + zero-credit 429/504 backoff
@function_tool
async def search_amazon_summary(
query: str,
country: str = "US",
max_retries: int = 3,
) -> dict[str, Any]:
"""Search Amazon products via EdgeData REST /v1/amazon/products/search with mode=summary."""
url = f"{REST_BASE_URL}/v1/amazon/products/search"
headers = {"X-API-Key": EDGEDATA_API_KEY}
params = {"query": query, "country": country, "mode": "summary"}
async with httpx.AsyncClient(timeout=20.0) as client:
for attempt in range(max_retries):
resp = await client.get(url, headers=headers, params=params)
# EdgeData charges strictly 0 credits on HTTP 429 / 504 upstream retries
if resp.status_code in (429, 504) and attempt + 1 < max_retries:
await asyncio.sleep(0.75 * (2 ** attempt))
continue
resp.raise_for_status()
return resp.json()
raise RuntimeError("Amazon search exhausted retry budget after 429/504 responses")
async def main() -> None:
# Scoped Hosted MCP subset: avoids injecting all 56 tool schemas on every turn
scoped_filter = create_static_tool_filter(
allowed_tool_names=[
"amazon_get_product_detail",
"amazon_get_reviews",
"walmart_get_item",
"walmart_get_offers",
"shopify_get_store_products",
"tradingview_get_quotes",
]
)
async with MCPServerStreamableHttp(
name="EdgeData",
params={
"url": MCP_ENDPOINT,
"headers": {"X-API-Key": EDGEDATA_API_KEY},
},
cache_tools_list=True,
tool_filter=scoped_filter,
) as mcp_server:
agent = Agent(
name="CommercePricingAnalyst",
model="gpt-4.1",
instructions=(
"Use search_amazon_summary for initial keyword discovery, then call "
"EdgeData Hosted MCP tools with mode='summary' for deep ASIN details, "
"Walmart offers, and Shopify store checks."
),
tools=[search_amazon_summary],
mcp_servers=[mcp_server],
)
result = await Runner.run(
agent,
"Compare top US listings for 'portable espresso maker' across Amazon and Walmart.",
)
print(result.final_output)
if __name__ == "__main__":
asyncio.run(main())
Dual-Track Rule of Thumb · Same Key, Zero Double Integration
Both https://mcp.upp3.com/mcp (Streamable HTTP) and https://api.upp3.com/v1/* authenticate with X-API-Key: ed_live_your_key_here and draw from one credit balance. Pin repeatable high-volume queries to @function_tool REST wrappers, while letting MCPServerStreamableHttp + create_static_tool_filter handle ad-hoc cross-platform follow-ups.
Architecture Selection · Production Trade-Offs
MCPServerStreamableHttp vs. @function_tool REST vs. Hybrid Dual-Track
Evaluate schema token overhead, parameter determinism, latency, and HTTP 429/504 retry ownership before locking your OpenAI Agents SDK topology.
Engineering Dimension
MCPServerStreamableHttp Only
@function_tool + REST /v1/*
Hybrid Dual-Track (Recommended)
Schema Context Overhead
Full 56 tools = ~17,920 tok/turn unless scoped via create_static_tool_filter + cache_tools_list=True
Minimal (~180–300 tok/tool): only Python functions you explicitly decorate enter the prompt
3 Verified Vertical Blueprints · 100% Live Tools & Routes
Production OpenAI Agents SDK Blueprints Across E-Commerce, Real Estate & Finance
Every blueprint pairs exact live Hosted MCP tools with verified /v1/* REST endpoints from EdgeData’s 16-platform production catalog.
Blueprint 01 · E-Commerce-81.3% Avg Tokens
Cross-Channel Competitor Price & Stock Monitor
Pin scheduled catalog discovery to REST @function_tool wrappers with 429/504 backoff, then hand off anomalous SKUs to scoped MCP tools for deep offer and review diagnostics.
Pinned @function_tool REST Routes
GET /v1/amazon/products/searchGET /v1/walmart/items/{item_id}/offersGET /v1/shopify/products/inventoryGET /v1/tiktok-shop/products/search
Combine deterministic metro trend snapshots over REST with exploratory property comps via Hosted MCP. Server-side 0-PII scrubbing strips personal agent emails and phone numbers before OpenAI sees any payload.
Pinned @function_tool REST Routes
GET /v1/real-estate/redfin/properties/searchGET /v1/real-estate/redfin/market/trendsGET /v1/real-estate/rightmove/properties/searchGET /v1/real-estate/rightmove/house-price-index
Only 4 MCP schemas mounted (~1,280 tok/turn vs ~17,920 unscoped), leaving room for multi-city comps.
All housing metrics remain informational telemetry only with zero PII leakage into traces.
Blueprint 03 · TradingView Finance50-Symbol Batch
TradingView Read-Only Equity & Macro Research Agent
Batch-pull up to 50 tickers in one REST call inside a deterministic @function_tool, then let the agent enrich catalysts with earnings calendars, Trustpilot brand sentiment, and LinkedIn hiring velocity.
Pinned @function_tool REST Routes
GET /v1/finance/tradingview/quotesGET /v1/finance/tradingview/calendar/earningsGET /v1/trustpilot/companies/by-domainGET /v1/linkedin/jobs/search
mode="summary" trims raw quote arrays so 50-ticker watchlists fit cleanly inside a single reasoning turn.
Read-only market telemetry paired with 0-credit retry protection on transient upstream 429/504 spikes.
Context Budget & Credit Guardrails · Zero Waste
Control Schema Tokens, Payload Size & Upstream Retry Budgets
Four production engineering levers keep OpenAI Agents SDK runs predictable under heavy multi-turn concurrency.
Schema Control · Static Filter
cache_tools_list=True + Scoped Subsets
Avoid injecting all 56 Hosted MCP schemas (~17,920 tokens/turn) into every OpenAI completion. Enable cache_tools_list=True and pass create_static_tool_filter with 4–8 vertical tools, then model exact monthly savings in our MCP Schema Budget Calculator.
Payload Compression · -81.3%
Server-Side mode="summary" Default
Strip bloated raw HTML descriptions and redundant image arrays before JSON hits OpenAI context. Across Amazon, Walmart, TikTok Shop, Redfin, Rightmove, and TradingView benchmarks, mode="summary" cuts payload tokens by -81.3% on average.
Billing & Privacy Guardrail
HTTP 504 / 429 = 0 Credits & 0-PII
Upstream timeouts (504) and rate limits (429) incur strictly 0 credits so your @function_tool backoff loop never double-bills. Stress-test retry budgets with the API Retry & Backoff Simulator. Server-side GDPR 0-PII scrubbing is always on.
Live 4-Tier Direct Pricing · Zero Subscription Lock-In Option
One API Key for Both Hosted MCP & REST /v1/*
Start free with 500 monthly credits, buy never-expiring credits once for burst workloads, or lock in predictable monthly SLAs as your OpenAI Agent fleet scales.
Direct answers on combining MCPServerStreamableHttp with @function_tool REST wrappers, static tool filtering, auth headers, 0-credit retries, and pricing.
When should an OpenAI Agents SDK app use MCPServerStreamableHttp vs @function_tool REST wrappers?
Use MCPServerStreamableHttp pointed at https://mcp.upp3.com/mcp when your agent needs flexible multi-platform exploration across EdgeData's 56 Hosted MCP tools without maintaining local schemas. Wrap https://api.upp3.com/v1/* endpoints in @function_tool when you need strict Python type validation, deterministic mode='summary' defaults, custom 429/504 backoff timers, or tight latency budgets—or combine both in a hybrid dual-track agent.
How do cache_tools_list=True and create_static_tool_filter reduce OpenAI Agents SDK token overhead?
Setting cache_tools_list=True avoids re-fetching tools/list on every turn, while create_static_tool_filter(allowed_tool_names=[...]) restricts the system prompt to 4 to 8 vertical tools instead of injecting all 56 JSON schemas on every reasoning step. Pairing scoped schemas with mode='summary' (-81.3% payload tokens) slashes total input token burn.
What authentication header and endpoints work for both Hosted MCP and REST @function_tool calls?
Pass X-API-Key: ed_live_your_key_here on both https://mcp.upp3.com/mcp (same-origin alias https://upp3.com/mcp) for Streamable HTTP MCP and https://api.upp3.com for all 67 /v1/* REST endpoints. A single EdgeData API key shares one credit wallet across both tracks.
Will exponential backoff retries inside my @function_tool burn credits on HTTP 504 or 429?
No. EdgeData strictly charges 0 credits whenever an upstream marketplace or data provider returns HTTP 504 gateway timeout or HTTP 429 rate-limit responses across all 56 Hosted MCP tools and 67 REST routes. Only successful HTTP 200 payloads deduct credits.
Which EdgeData pricing tiers support dual-track OpenAI Agents SDK production workloads?
All four live tiers unlock every Hosted MCP tool and REST route with server-side GDPR 0-PII scrubbing: Free ($0/mo, 500 credits/mo, no card required), Starter Credit Pack ($47 once for 25,000 never-expiring credits at $1.88 per 1k credits), Pro ($49/mo for 15,000 credits/mo), and Scale ($149/mo for 60,000 credits/mo).