{
  "$schema": "https://modelcontextprotocol.io/schema/server-card/v1.json",
  "serverInfo": {
    "name": "Mandi Rate MCP Server",
    "version": "1.0.0",
    "description": "Model Context Protocol interface to Pakistan daily mandi vegetable market rates, vendor pricing, catalog, and home delivery ordering."
  },
  "transport": {
    "type": "sse",
    "endpoint": "https://mandirate.com/api/mcp"
  },
  "capabilities": {
    "tools": [
      {
        "name": "get_daily_rates",
        "description": "Fetch real-time daily vegetable market rates (per kg, 5kg, and Mann) across Pakistan mandis (e.g. Lahore, Karachi, Rawalpindi).",
        "inputSchema": {
          "type": "object",
          "properties": {
            "mandiId": {
              "type": "string",
              "description": "Optional Mandi ID (e.g., 'mandi-lahore-badami-bagh')."
            },
            "category": {
              "type": "string",
              "description": "Optional category filter ('Daily Essentials', 'Green Veggies', 'Root & Tubers', 'Gourds & Squash', 'Herbs & Aromatics', 'Specialty')."
            }
          }
        }
      },
      {
        "name": "get_vegetable_details",
        "description": "Get detailed pricing, stock availability, units, and images for a specific vegetable.",
        "inputSchema": {
          "type": "object",
          "properties": {
            "vegetableId": {
              "type": "string",
              "description": "Unique identifier of the vegetable item."
            }
          },
          "required": ["vegetableId"]
        }
      },
      {
        "name": "search_vegetables",
        "description": "Search vegetables by name in English or Urdu (e.g., 'Tomato', 'Tamatar', 'Aloo', 'Onion').",
        "inputSchema": {
          "type": "object",
          "properties": {
            "query": {
              "type": "string",
              "description": "Search keyword in English or Urdu script/roman."
            }
          },
          "required": ["query"]
        }
      },
      {
        "name": "place_vegetable_order",
        "description": "Submit a customer delivery order for fresh vegetables from Mandi Rate.",
        "inputSchema": {
          "type": "object",
          "properties": {
            "customerName": { "type": "string" },
            "customerPhone": { "type": "string" },
            "deliveryAddress": { "type": "string" },
            "mandiId": { "type": "string" },
            "items": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "vegetableId": { "type": "string" },
                  "name": { "type": "string" },
                  "quantity": { "type": "number" },
                  "unit": { "type": "string" },
                  "pricePerUnit": { "type": "number" }
                },
                "required": ["vegetableId", "name", "quantity", "pricePerUnit"]
              }
            }
          },
          "required": ["customerName", "customerPhone", "deliveryAddress", "items"]
        }
      }
    ],
    "resources": [
      {
        "uri": "mandirate://rates/today",
        "name": "Today's Mandi Rates",
        "mimeType": "application/json",
        "description": "Consolidated snapshot of current daily vegetable rates across all active mandis."
      }
    ]
  }
}
