{
  "$schema": "https://modelcontextprotocol.io/schema/mcp-server-manifest.json",
  "name": "mytop8-agent-gateway",
  "version": "3.0.0",
  "description": "MyTop8 Autonomous Agent Transaction & Trust Gateway. Provides vetted local and remote service discovery with a strict Top 8 context ceiling, deterministic SLA inspection, bounded spending wallets, two-phase escrow (2.5% protocol fee), and cryptographic HMAC-SHA256 reputation receipts.",
  "website": "https://mytop8.app",
  "documentation": "https://mytop8.app/llms.txt",
  "transport": {
    "type": "stdio",
    "command": "python",
    "args": ["mcp_server.py"],
    "github_url": "https://github.com/justin11691/rural-reckless-app/tree/main/mytop8_mvp"
  },
  "rest_api_base": "https://mytop8.app/api/v1",
  "tools": [
    {
      "name": "mytop8_search_services",
      "description": "Searches the MyTop8 verified business registry for local merchants, contractors, and services. Returns the Top 8 vetted providers with exact pricing, turnaround SLAs, and machine-readable contracts.",
      "parameters": {
        "type": "object",
        "properties": {
          "category": { "type": "string", "description": "e.g. Automotive, Home Services, Tech & AI, Artisans & Makers" },
          "location": { "type": "string", "description": "City or region, e.g. Show Low, AZ, Remote" },
          "q": { "type": "string", "description": "Keyword search (e.g. ECU tuning, solar, pellet stove)" },
          "limit": { "type": "integer", "default": 8, "description": "Max 8" }
        }
      }
    },
    {
      "name": "mytop8_get_business_contract",
      "description": "Fetches the full agent.json contract manifest for a specific merchant, including offerings, turnaround times, and cancellation terms.",
      "parameters": {
        "type": "object",
        "properties": {
          "business_id": { "type": "string", "description": "Business ID slug, e.g. apex-ecu-tuning" }
        },
        "required": ["business_id"]
      }
    },
    {
      "name": "mytop8_verify_contract",
      "description": "Verifies that a service offering matches the agent's pre-authorized spending budget and delivery SLA.",
      "parameters": {
        "type": "object",
        "properties": {
          "business_id": { "type": "string", "description": "Target business ID" },
          "service_id": { "type": "string", "description": "Target service ID" },
          "max_budget_usd": { "type": "number", "description": "Maximum authorized spending budget in USD" }
        },
        "required": ["business_id", "service_id", "max_budget_usd"]
      }
    },
    {
      "name": "mytop8_lock_escrow",
      "description": "Locks funds from an agent's delegated wallet into two-phase escrow (service price + 2.5% platform fee).",
      "parameters": {
        "type": "object",
        "properties": {
          "auth_token": { "type": "string", "description": "Agent wallet authorization token" },
          "business_id": { "type": "string", "description": "Merchant ID" },
          "service_id": { "type": "string", "description": "Offering ID" },
          "task_notes": { "type": "string", "description": "Booking instructions or requirements" }
        },
        "required": ["auth_token", "business_id", "service_id"]
      }
    },
    {
      "name": "mytop8_release_escrow",
      "description": "Releases locked escrow funds to the merchant upon verified delivery, retaining the 2.5% protocol fee and generating an immutable cryptographic HMAC-SHA256 reputation signature.",
      "parameters": {
        "type": "object",
        "properties": {
          "escrow_id": { "type": "string", "description": "Escrow ID" },
          "confirmation_notes": { "type": "string", "description": "Confirmation of verified delivery" }
        },
        "required": ["escrow_id"]
      }
    },
    {
      "name": "mytop8_refund_escrow",
      "description": "Refunds 100% of held escrow funds back to the agent's wallet if service delivery is cancelled or fails SLA.",
      "parameters": {
        "type": "object",
        "properties": {
          "escrow_id": { "type": "string", "description": "Escrow ID" },
          "reason": { "type": "string", "description": "Cancellation rationale" }
        },
        "required": ["escrow_id"]
      }
    },
    {
      "name": "mytop8_check_wallet_balance",
      "description": "Audits the current balance, spending ceiling, and authorized categories for an agent wallet.",
      "parameters": {
        "type": "object",
        "properties": {
          "auth_token": { "type": "string", "description": "Agent token" }
        },
        "required": ["auth_token"]
      }
    },
    {
      "name": "mytop8_list_categories",
      "description": "Lists all available business and service categories in the MyTop8 ecosystem.",
      "parameters": {
        "type": "object",
        "properties": {}
      }
    }
  ]
}
