The rules

Before completing any purchase of something that must work with what the customer owns:
1. Call check_cart_before_checkout with the cart and what the customer owns.
2. Act only on "action": proceed, resolve_conditions, do_not_checkout or ask_customer.
3. Complete the checkout only when safe_to_checkout is true, or after every condition is met.
4. Never treat insufficient_evidence as a yes. Ask the customer the returned questions instead.
5. Keep the receipt id with the order.

OpenAI Agents SDK

pip install openai-agents

import asyncio
from agents import Agent, Runner
from agents.mcp import MCPServerStreamableHttp

RULES = """Before completing any purchase of something that must work with what the customer owns:
1. Call check_cart_before_checkout with the cart and what the customer owns.
2. Act only on "action": proceed, resolve_conditions, do_not_checkout or ask_customer.
3. Complete the checkout only when safe_to_checkout is true, or after every condition is met.
4. Never treat insufficient_evidence as a yes. Ask the customer the returned questions instead.
5. Keep the receipt id with the order."""

async def main():
    async with MCPServerStreamableHttp(
        name="tethered-trust",
        params={"url": "https://tetheredtrust.com/mcp",
                "headers": {"Authorization": "Bearer tt_..."}},  # key optional
    ) as tt:
        agent = Agent(name="Shopper", instructions=RULES, mcp_servers=[tt])
        result = await Runner.run(agent,
            "I have a TCL 65QM8K. Buy a tilting wall mount for it.")
        print(result.final_output)

asyncio.run(main())

Claude Agent SDK

pip install claude-agent-sdk. Tools are named mcp__tethered-trust__<tool>.

import asyncio
from claude_agent_sdk import ClaudeSDKClient, ClaudeAgentOptions

RULES = """Before completing any purchase of something that must work with what the customer owns:
1. Call check_cart_before_checkout with the cart and what the customer owns.
2. Act only on "action": proceed, resolve_conditions, do_not_checkout or ask_customer.
3. Complete the checkout only when safe_to_checkout is true, or after every condition is met.
4. Never treat insufficient_evidence as a yes. Ask the customer the returned questions instead.
5. Keep the receipt id with the order."""

options = ClaudeAgentOptions(
    system_prompt=RULES,
    mcp_servers={"tethered-trust": {
        "type": "http",
        "url": "https://tetheredtrust.com/mcp",
        "headers": {"Authorization": "Bearer tt_..."},  # key optional
    }},
    allowed_tools=[
        "mcp__tethered-trust__check_cart_before_checkout",
        "mcp__tethered-trust__validate_purchase_plan",
        "mcp__tethered-trust__identify_product",
    ],
)

async def main():
    async with ClaudeSDKClient(options=options) as client:
        await client.query("I have a 2025 Tesla Model Y. Is a ChargePoint Home Flex J1772 OK to buy?")
        async for message in client.receive_response():
            print(message)

asyncio.run(main())

LangChain / LangGraph

pip install langchain langchain-mcp-adapters. create_agent runs on LangGraph.

import asyncio
from langchain.agents import create_agent
from langchain_mcp_adapters.client import MultiServerMCPClient

RULES = """Before completing any purchase of something that must work with what the customer owns:
1. Call check_cart_before_checkout with the cart and what the customer owns.
2. Act only on "action": proceed, resolve_conditions, do_not_checkout or ask_customer.
3. Complete the checkout only when safe_to_checkout is true, or after every condition is met.
4. Never treat insufficient_evidence as a yes. Ask the customer the returned questions instead.
5. Keep the receipt id with the order."""

async def main():
    client = MultiServerMCPClient({"tethered-trust": {
        "transport": "streamable_http",
        "url": "https://tetheredtrust.com/mcp",
        "headers": {"Authorization": "Bearer tt_..."},  # key optional
    }})
    tools = await client.get_tools()
    agent = create_agent("openai:gpt-4.1", tools, system_prompt=RULES)
    out = await agent.ainvoke({"messages": [{"role": "user",
        "content": "My laptop is a Lenovo ThinkPad T480. Add 32 GB of RAM to the cart."}]})
    print(out["messages"][-1].content)

asyncio.run(main())

Plain HTTP

curl -s https://tetheredtrust.com/v1/checkout/check \
  -H 'Content-Type: application/json' \
  -d '{"owned": ["TCL 65QM8K"],
       "line_items": [{"id": "li_1", "title": "Sanus VLT7 tilting TV mount", "quantity": 1}]}'

Every endpoint is in the OpenAPI 3.1 spec; clients for JavaScript and Python are in the console. Try anything free in the sandbox: scenarios.

Which tool when

The agent is…Tool
about to pay for a cartcheck_cart_before_checkout
planning several purchases around what the customer ownsvalidate_purchase_plan, then recheck_plan before ordering
comparing one product with one devicecheck_compatibility
holding a URL, model number or UPC and unsure what it isidentify_product
proving later what it was toldverify_receipt

More: For AI agents · UCP and ACP checkouts · Pricing.