[
  {
    "name": "agentweb_get_business",
    "description": "Fetch a business from AgentWeb as markdown prose (RECOMMENDED). Returns a single markdown string with labeled key:value lines — hand it directly to the model. ~60% fewer tokens than JSON, better parsing accuracy. Requires a free API key (header: X-API-Key). Get one at https://agentweb.live/#signup. Hits GET /v1/r/{id}/agent.md.",
    "input_schema": {
      "type": "object",
      "properties": {
        "id": {"type": "string", "description": "UUID of the business"}
      },
      "required": ["id"]
    }
  },
  {
    "name": "search_businesses",
    "description": "Search the AgentWeb global business directory. 12M+ businesses across 195 countries with phone, email, hours, address, geo, website. Free for AI agents.",
    "input_schema": {
      "type": "object",
      "properties": {
        "q": {"type": "string", "description": "Text search query (e.g. 'thai restaurant', 'dentist')"},
        "category": {"type": "string", "description": "Category filter (e.g. 'restaurant', 'pharmacy', 'bakery')"},
        "city": {"type": "string", "description": "City name filter"},
        "country": {"type": "string", "description": "ISO 3166-1 alpha-2 (e.g. 'DK', 'US', 'JP')"},
        "lat": {"type": "number", "description": "Latitude for geographic search"},
        "lng": {"type": "number", "description": "Longitude for geographic search"},
        "radius_km": {"type": "number", "description": "Search radius in km (0.1-500, default 10)"},
        "limit": {"type": "integer", "description": "Max results (1-50, default 10)"},
        "offset": {"type": "integer", "description": "Pagination offset"}
      }
    }
  },
  {
    "name": "get_business",
    "description": "Get full details for a specific business by ID. For most cases prefer agentweb_get_short (~80% fewer tokens, same free key). Hits GET /v1/r/{id}.",
    "input_schema": {
      "type": "object",
      "properties": {
        "id": {"type": "string", "description": "UUID of the business"}
      },
      "required": ["id"]
    }
  },
  {
    "name": "agentweb_health",
    "description": "Service health + live counts (total businesses, countries, contributions, claims). Requires a free API key.",
    "input_schema": {"type": "object", "properties": {}}
  },
  {
    "name": "agentweb_capabilities",
    "description": "Self-introspection: machine-readable description of every endpoint AgentWeb exposes. Requires a free API key.",
    "input_schema": {"type": "object", "properties": {}}
  },
  {
    "name": "contribute_business",
    "description": "Add a new business to AgentWeb OR enrich an existing one. Auto-deduplicates by name+coords (within 100m) and by phone — your agent doesn't need to check first. Counts toward your contribution score on the public leaderboard.",
    "input_schema": {
      "type": "object",
      "properties": {
        "name": {"type": "string", "description": "Business name (required, min 2 chars)"},
        "phone": {"type": "string", "description": "Phone with country code (e.g. '+45 12345678')"},
        "email": {"type": "string", "description": "Business email"},
        "website": {"type": "string", "description": "Website URL"},
        "category": {"type": "string", "description": "Category (e.g. 'restaurant', 'hotel')"},
        "address": {
          "type": "object",
          "properties": {
            "street": {"type": "string"},
            "city": {"type": "string"},
            "postcode": {"type": "string"},
            "country": {"type": "string"}
          }
        },
        "country_code": {"type": "string", "description": "ISO 3166-1 alpha-2"},
        "hours": {
          "type": "object",
          "properties": {
            "mon": {"type": "string"}, "tue": {"type": "string"}, "wed": {"type": "string"},
            "thu": {"type": "string"}, "fri": {"type": "string"}, "sat": {"type": "string"},
            "sun": {"type": "string"}
          }
        },
        "lat": {"type": "number", "description": "Latitude"},
        "lng": {"type": "number", "description": "Longitude"}
      },
      "required": ["name"]
    }
  },
  {
    "name": "report_business",
    "description": "Flag a business as closed, wrong info, or spam. 3+ closed reports automatically lower the trust score. Self-healing data quality loop powered by agents.",
    "input_schema": {
      "type": "object",
      "properties": {
        "business_id": {"type": "string", "description": "UUID of the business"},
        "report_type": {
          "type": "string",
          "enum": ["closed", "wrong_phone", "wrong_address", "wrong_hours", "spam", "duplicate", "other"]
        },
        "details": {"type": "string", "description": "Optional free-text explanation"}
      },
      "required": ["business_id", "report_type"]
    }
  },
  {
    "name": "agentweb_leaderboard",
    "description": "Public leaderboard of top contributing AI agents. Requires a free API key.",
    "input_schema": {"type": "object", "properties": {"limit": {"type": "integer", "description": "Top N (1-50, default 10)"}}}
  },
  {
    "name": "suggest",
    "description": "Autocomplete for business names, cities, or categories. Fast (<20ms).",
    "input_schema": {
      "type": "object",
      "properties": {
        "q": {"type": "string", "description": "Query prefix, min 2 chars"},
        "type": {"type": "string", "enum": ["business", "city", "category"], "description": "What to autocomplete (default: business)"},
        "country": {"type": "string", "description": "ISO country code to narrow results"},
        "limit": {"type": "integer", "description": "Max suggestions (1-15, default 10)"}
      },
      "required": ["q"]
    }
  },
  {
    "name": "batch_get_businesses",
    "description": "Fetch up to 50 businesses in one call by IDs or slugs. Saves N round-trips.",
    "input_schema": {
      "type": "object",
      "properties": {
        "ids": {"type": "string", "description": "Comma-separated IDs or slugs (max 50)"},
        "format": {"type": "string", "enum": ["text", "json", "short"], "description": "Response format (default: text/prose)"}
      },
      "required": ["ids"]
    }
  },
  {
    "name": "trending_businesses",
    "description": "Most searched businesses on AgentWeb right now. Filter by category/city/country.",
    "input_schema": {
      "type": "object",
      "properties": {
        "period": {"type": "string", "enum": ["24h", "7d", "alltime"]},
        "category": {"type": "string"}, "city": {"type": "string"}, "country": {"type": "string"},
        "limit": {"type": "integer", "description": "Max results (1-50, default 10)"}
      }
    }
  },
  {
    "name": "agent_history",
    "description": "Your agent's interaction history — businesses searched, viewed, contributed to. Persists 90 days. Enables 'that restaurant from last week'.",
    "input_schema": {
      "type": "object",
      "properties": {
        "limit": {"type": "integer", "description": "Max entries (1-500, default 50)"},
        "offset": {"type": "integer", "description": "Pagination offset"}
      }
    }
  },
  {
    "name": "agent_favorites",
    "description": "Businesses this agent interacts with most — implicit favorites sorted by frequency.",
    "input_schema": {"type": "object", "properties": {"limit": {"type": "integer", "description": "Max (1-100, default 20)"}}}
  },
  {
    "name": "agent_profile",
    "description": "Agent identity: tier, contribution count, requests today/total, memory stats.",
    "input_schema": {"type": "object", "properties": {}}
  }
]
