← All integrations

Anthropic tool use integration

Anthropic Claude tool definitions for the Ontario paid endpoints. Same shape as the OpenAI tools, slightly different schema field names.

Reference docs: https://docs.anthropic.com/en/docs/build-with-claude/tool-use  |  Machine-readable: /integrations/anthropic.json

Snippet

import anthropic
import httpx

client = anthropic.Anthropic()

TOOLS = [
    {
        "name": "agent_trust_scan",
        "description": "Scan an agent endpoint for x402/A2A trust signals.",
        "input_schema": {
            "type": "object",
            "properties": {
                "target_url": {"type": "string"}
            },
            "required": ["target_url"]
        }
    }
]

def call_agent_trust_scan(target_url: str) -> dict:
    r = httpx.post(
        "https://ontarioprotocol.com/api/x402/agent-trust-scan",
        json={"target_url": target_url},
        timeout=30,
    )
    r.raise_for_status()
    return r.json()

Endpoints wired

Want to test without paying? Use POST /api/demo/agent-trust-scan — free, rate-limited, same response shape.