Skill: regalstreak/swiggy (version 1.0.5)

--- name: swiggy description: "Order food, groceries, and book restaurants in India via Swiggy's MCP servers. Food delivery, Instamart groceries, and Dineout restaurant bookings with safety-first confirmation workflow." --- # Swiggy Skill Order food, groceries, and book restaurants in India via Swiggy's MCP servers. ## Installation The skill includes a `swiggy` CLI binary. After installing the skill: ```bash cd skills/swiggy npm link ``` This creates a global `swiggy` command. Verify with: `which swiggy` ## When to Use - Food delivery: "Order biryani", "What's open late?", "Team lunch for 8" - Groceries (Instamart): "Get eggs and milk", "Weekly groceries", "Recipe ingredients" - Restaurant bookings (Dineout): "Book dinner Saturday 8pm", "Italian in Koramangala" ## Available Commands ### Food Delivery ```bash # Search restaurants swiggy food search "biryani" --location "Koramangala, Bengaluru" # Get menu swiggy food menu <restaurant-id> # Cart management swiggy food cart add <item-id> --quantity 2 swiggy food cart show swiggy food cart clear # Order (requires confirmation) swiggy food order --address "home" --confirm ``` ### Instamart (Groceries) ```bash # Search products swiggy im search "eggs" --location "HSR Layout, Bengaluru" # Cart operations swiggy im cart add <item-id> --quantity 3 swiggy im cart show swiggy im cart clear # Checkout (requires confirmation) swiggy im order --address "home" --confirm ``` ### Dineout (Restaurant Bookings) ```bash # Search restaurants swiggy dineout search "Italian Indiranagar" # Get details swiggy dineout details <restaurant-id> # Check availability swiggy dineout slots <restaurant-id> --date 2026-01-30 # Book table (free bookings only, requires confirmation) swiggy dineout book <restaurant-id> --date 2026-01-30 --time 20:00 --guests 2 --confirm ``` ## CRITICAL: Safety Rules ### ⚠️ NEVER Auto-Order **ALWAYS get explicit confirmation before placing orders.** 1. **Show cart preview first:** - All items with quantities and prices - Total amount - Delivery address - Estimated delivery time (food/groceries) 2. **Ask for confirmation:** ``` Ready to order: - 2x Chicken Biryani (₹500) - 1x Raita (₹60) Total: ₹560 + delivery Deliver to: Home (HSR Layout) ETA: 30-40 mins Confirm order? (yes/no) ``` 3. **Only after user says YES:** - Run the order command with `--confirm` flag - Log to `memory/swiggy-orders.json` ### COD Warning Swiggy MCP currently supports **Cash on Delivery only**. Orders **cannot be cancelled** once placed. Always double-check before confirming. ### Address Handling - User may say "home", "office", etc. - map to actual addresses from USER.md or ask - Always confirm delivery location in preview - For Dineout, location is used for search only (not delivery) ## Workflow Examples ### Food Order Flow ```bash # 1. Search swiggy food search "biryani near Koramangala" # 2. Browse menu (use restaurant ID from search) swiggy food menu rest_12345 # 3. Add to cart swiggy food cart add item_67890 --quantity 1 # 4. Preview cart swiggy food cart show # 5. Show preview to user, ask confirmation # 6. If confirmed, order swiggy food order --address "HSR Layout, Sector 2, Bengaluru" --confirm ``` ### Grocery Shopping Flow ```bash # 1. Search items swiggy im search "eggs" --location "Koramangala" swiggy im search "milk" --location "Koramangala" # 2. Add to cart swiggy im cart add item_11111 --quantity 2 swiggy im cart add item_22222 --quantity 1 # 3. Preview swiggy im cart show # 4. Confirm with user # 5. Checkout swiggy im order --address "Koramangala, Bengaluru" --confirm ``` ### Restaurant Booking Flow ```bash # 1. Search swiggy dineout search "Italian Indiranagar" # 2. Check details swiggy dineout details rest_99999 # 3. Check slots swiggy dineout slots rest_99999 --date 2026-01-30 # 4. Show options to user, confirm choice # 5. Book swiggy dineout book rest_99999 --date 2026-01-30 --time 20:00 --guests 2 --confirm ``` ## Error Handling - **No results:** Suggest broader search or different location - **Out of stock:** Show alternatives - **No slots available:** Suggest different times/dates - **Authentication required:** User needs to authenticate via OAuth (handled by MCP) ## Tips - For team orders: build cart iteratively, ask for preferences - For budget shopping: filter results by price, show running total - For recipe-to-cart: search each ingredient, add progressively - For late night: mention delivery time in search criteria ## Order Logging After successful order, append to `memory/swiggy-orders.json`: ```json { "timestamp": "2026-01-28T21:16:00+05:30", "type": "food", "items": [...], "total": "₹560", "address": "HSR Layout", "orderId": "..." } ``` ## Authentication Swiggy MCP uses OAuth. First use will trigger auth flow. The `swiggy` CLI handles this via mcporter. ## Dependencies - Requires `mcporter` skill (uses it under the hood) - Node.js runtime for the CLI wrapper ## Known Limitations - COD only (no online payment yet) - Orders cannot be cancelled - Dineout: free bookings only - Don't open Swiggy app while using MCP (session conflicts) --- **Remember: Confirmation BEFORE ordering. Every. Single. Time.** 🐾

path: README.md
content: # Swiggy Skill for Clawdbot

Order food, groceries, and book restaurant tables in India through your AI agent.

## What It Does

This skill integrates Swiggy's MCP servers into Clawdbot:

- **Food Delivery** - Search restaurants, browse menus, order food
- **Instamart** - Grocery shopping and delivery
- **Dineout** - Restaurant discovery and table bookings

## Installation

**Via ClawdHub:**
```bash
clawdhub install swiggy
cd skills/swiggy
npm link
```

**Manual:**
```bash
cd ~/clawd/skills/swiggy
npm link
```

This makes the `swiggy` command available globally.

**Verify installation:**
```bash
which swiggy
swiggy  # Should show usage help
```

## Quick Start

### Food Delivery

```bash
# Search for restaurants
swiggy food search "biryani" --location "Koramangala, Bengaluru"

# Browse menu
swiggy food menu rest_12345

# Add to cart
swiggy food cart add item_67890 --quantity 2

# View cart
swiggy food cart show

# Place order (requires --confirm flag)
swiggy food order --address "HSR Layout, Bengaluru" --confirm
```

### Groceries (Instamart)

```bash
# Search products
swiggy im search "eggs" --location "HSR Layout"

# Add to cart
swiggy im cart add prod_11111 --quantity 2

# Checkout
swiggy im order --address "HSR Layout, Bengaluru" --confirm
```

### Restaurant Bookings (Dineout)

```bash
# Search restaurants
swiggy dineout search "Italian Indiranagar"

# Check availability
swiggy dineout slots rest_99999 --date 2026-01-30

# Book table
swiggy dineout book rest_99999 --date 2026-01-30 --time 20:00 --guests 2 --confirm
```

## Safety Features

### Confirmation Required

The `--confirm` flag is **mandatory** for all orders and bookings. This prevents accidental purchases.

Without `--confirm`:
```bash
swiggy food order --address "home"
# ❌ Error: --confirm flag required
```

With `--confirm`:
```bash
swiggy food order --address "home" --confirm
# ✅ Order placed
```

### Always Preview First

**Workflow:**
1. Build cart (`cart add`)
2. Preview (`cart show`)
3. Confirm with user
4. Order (`order --confirm`)

### COD Only

⚠️ Currently supports **Cash on Delivery only**. Orders **cannot be cancelled** after placement.

## How It Works

The skill uses `mcporter` to connect to Swiggy's HTTP MCP servers:

- Food: `https://mcp.swiggy.com/food`
- Instamart: `https://mcp.swiggy.com/im`
- Dineout: `https://mcp.swiggy.com/dineout`

## Authentication

First use will trigger OAuth flow. Follow the prompts to authenticate with your Swiggy account.

## Use Cases

### "Order me lunch"
```
User: Order biryani for lunch
Agent: 
  1. searches "biryani near <location>"
  2. shows top results
  3. user picks restaurant
  4. browses menu
  5. adds to cart
  6. shows preview with total
  7. asks for confirmation
  8. places order with --confirm
```

### "Weekly groceries"
```
User: Get eggs, milk, bread
Agent:
  1. searches each item
  2. adds to cart
  3. shows cart total
  4. confirms address
  5. places order
```

### "Book dinner"
```
User: Italian dinner Saturday 8pm for 2 in Koramangala
Agent:
  1. searches restaurants
  2. checks slots
  3. shows options
  4. books with --confirm
```

## Limitations

- COD only (no online payment yet)
- Orders cannot be cancelled
- Dineout: free bookings only
- Don't use Swiggy app simultaneously (session conflicts)

## Dependencies

- Node.js ≥ 18
- `mcporter` skill (must be installed)
- Active internet connection
- Swiggy account (for OAuth)

## Troubleshooting

**"mcporter not found"**
→ Install the mcporter skill first

**"Authentication failed"**
→ Run `mcporter auth --server https://mcp.swiggy.com/food` manually

**"No results found"**
→ Try broader search terms or different location

**"Session conflict"**
→ Close Swiggy app before using MCP

## Credits

Built for Clawdbot by Neil Agarwal.

MCP servers provided by Swiggy (https://github.com/Swiggy/swiggy-mcp-server-manifest).

## License

MIT


path: package.json
content: {
  "name": "clawdbot-skill-swiggy",
  "version": "1.0.5",
  "description": "Swiggy integration for Clawdbot - order food, groceries, and book restaurants in India",
  "main": "bin/swiggy",
  "bin": {
    "swiggy": "./swiggy-cli.js"
  },
  "files": [
    "bin",
    "lib",
    "SKILL.md",
    "README.md",
    "swiggy-cli.js"
  ],
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [
    "swiggy",
    "food-delivery",
    "groceries",
    "instamart",
    "dineout",
    "india",
    "mcp",
    "clawdbot"
  ],
  "author": "Neil Agarwal",
  "license": "MIT",
  "dependencies": {},
  "peerDependencies": {
    "clawdbot": "*"
  },
  "engines": {
    "node": ">=18.0.0"
  },
  "clawdbot": {
    "skill": {
      "name": "swiggy",
      "category": "lifestyle",
      "mcpServers": {
        "swiggy-food": {
          "type": "http",
          "url": "https://mcp.swiggy.com/food"
        },
        "swiggy-instamart": {
          "type": "http",
          "url": "https://mcp.swiggy.com/im"
        },
        "swiggy-dineout": {
          "type": "http",
          "url": "https://mcp.swiggy.com/dineout"
        }
      }
    }
  }
}


path: swiggy-cli.js
content: #!/usr/bin/env node

/**
 * Swiggy CLI - Wrapper for Swiggy MCP servers
 * Uses mcporter under the hood to connect to:
 * - https://mcp.swiggy.com/food
 * - https://mcp.swiggy.com/im (Instamart)
 * - https://mcp.swiggy.com/dineout
 */

const { execSync } = require('child_process');
const fs = require('fs');
const path = require('path');

const MCP_SERVERS = {
  food: 'https://mcp.swiggy.com/food',
  im: 'https://mcp.swiggy.com/im',
  dineout: 'https://mcp.swiggy.com/dineout'
};

function exec(cmd) {
  try {
    return execSync(cmd, { encoding: 'utf8', stdio: 'pipe' });
  } catch (err) {
    console.error('Error:', err.message);
    if (err.stderr) console.error(err.stderr);
    process.exit(1);
  }
}

function callMCP(server, tool, args = {}) {
  const argsJson = JSON.stringify(args);
  const cmd = `mcporter call --server "${MCP_SERVERS[server]}" --tool "${tool}" --args '${argsJson}'`;
  return exec(cmd);
}

function main() {
  const args = process.argv.slice(2);
  
  if (args.length === 0) {
    console.log(`
Swiggy CLI - Order food, groceries, and book restaurants

Usage:
  swiggy food search <query> [--location <loc>]
  swiggy food menu <restaurant-id>
  swiggy food cart add <item-id> [--quantity <n>]
  swiggy food cart show
  swiggy food cart clear
  swiggy food order --address <addr> --confirm

  swiggy im search <query> [--location <loc>]
  swiggy im cart add <item-id> [--quantity <n>]
  swiggy im cart show
  swiggy im cart clear
  swiggy im order --address <addr> --confirm

  swiggy dineout search <query>
  swiggy dineout details <restaurant-id>
  swiggy dineout slots <restaurant-id> --date <YYYY-MM-DD>
  swiggy dineout book <restaurant-id> --date <YYYY-MM-DD> --time <HH:MM> --guests <n> --confirm

Options:
  --location    Delivery location (for food/im search)
  --quantity    Item quantity (default: 1)
  --address     Delivery address (required for orders)
  --date        Booking date (YYYY-MM-DD)
  --time        Booking time (HH:MM)
  --guests      Number of guests
  --confirm     Required flag to confirm orders/bookings

Examples:
  swiggy food search "biryani" --location "Koramangala, Bengaluru"
  swiggy im search "eggs" --location "HSR Layout"
  swiggy dineout search "Italian Indiranagar"
`);
    process.exit(0);
  }

  const [service, action, ...rest] = args;

  if (!['food', 'im', 'dineout'].includes(service)) {
    console.error('Invalid service. Use: food, im, or dineout');
    process.exit(1);
  }

  // Parse flags
  const flags = {};
  let positional = [];
  for (let i = 0; i < rest.length; i++) {
    if (rest[i].startsWith('--')) {
      const key = rest[i].slice(2);
      const value = rest[i + 1] && !rest[i + 1].startsWith('--') ? rest[i + 1] : true;
      flags[key] = value;
      if (value !== true) i++; // Skip next arg
    } else {
      positional.push(rest[i]);
    }
  }

  // Route commands to appropriate MCP tools
  let result;

  switch (service) {
    case 'food':
      result = handleFood(action, positional, flags);
      break;
    case 'im':
      result = handleInstamart(action, positional, flags);
      break;
    case 'dineout':
      result = handleDineout(action, positional, flags);
      break;
  }

  console.log(result);
}

function handleFood(action, positional, flags) {
  switch (action) {
    case 'search':
      return callMCP('food', 'search_restaurants', {
        query: positional[0] || '',
        location: flags.location
      });
    
    case 'menu':
      return callMCP('food', 'get_menu', {
        restaurant_id: positional[0]
      });
    
    case 'cart':
      const cartAction = positional[0];
      if (cartAction === 'add') {
        return callMCP('food', 'add_to_cart', {
          item_id: positional[1],
          quantity: parseInt(flags.quantity || 1)
        });
      } else if (cartAction === 'show') {
        return callMCP('food', 'view_cart', {});
      } else if (cartAction === 'clear') {
        return callMCP('food', 'clear_cart', {});
      }
      break;
    
    case 'order':
      if (!flags.confirm) {
        console.error('⚠️  ERROR: --confirm flag required to place order');
        console.error('This is a safety check. Review cart first with: swiggy food cart show');
        process.exit(1);
      }
      if (!flags.address) {
        console.error('ERROR: --address required for order');
        process.exit(1);
      }
      return callMCP('food', 'place_order', {
        address: flags.address
      });
    
    default:
      console.error(`Unknown food action: ${action}`);
      process.exit(1);
  }
}

function handleInstamart(action, positional, flags) {
  switch (action) {
    case 'search':
      return callMCP('im', 'search_products', {
        query: positional[0] || '',
        location: flags.location
      });
    
    case 'cart':
      const cartAction = positional[0];
      if (cartAction === 'add') {
        return callMCP('im', 'add_to_cart', {
          product_id: positional[1],
          quantity: parseInt(flags.quantity || 1)
        });
      } else if (cartAction === 'show') {
        return callMCP('im', 'view_cart', {});
      } else if (cartAction === 'clear') {
        return callMCP('im', 'clear_cart', {});
      }
      break;
    
    case 'order':
      if (!flags.confirm) {
        console.error('⚠️  ERROR: --confirm flag required to place order');
        console.error('This is a safety check. Review cart first with: swiggy im cart show');
        process.exit(1);
      }
      if (!flags.address) {
        console.error('ERROR: --address required for order');
        process.exit(1);
      }
      return callMCP('im', 'checkout', {
        address: flags.address
      });
    
    default:
      console.error(`Unknown instamart action: ${action}`);
      process.exit(1);
  }
}

function handleDineout(action, positional, flags) {
  switch (action) {
    case 'search':
      return callMCP('dineout', 'search_restaurants', {
        query: positional[0] || '',
        location: flags.location
      });
    
    case 'details':
      return callMCP('dineout', 'get_details', {
        restaurant_id: positional[0]
      });
    
    case 'slots':
      if (!flags.date) {
        console.error('ERROR: --date required (format: YYYY-MM-DD)');
        process.exit(1);
      }
      return callMCP('dineout', 'check_availability', {
        restaurant_id: positional[0],
        date: flags.date
      });
    
    case 'book':
      if (!flags.confirm) {
        console.error('⚠️  ERROR: --confirm flag required to book table');
        console.error('This is a safety check. Review details first.');
        process.exit(1);
      }
      if (!flags.date || !flags.time || !flags.guests) {
        console.error('ERROR: --date, --time, and --guests required for booking');
        process.exit(1);
      }
      return callMCP('dineout', 'book_table', {
        restaurant_id: positional[0],
        date: flags.date,
        time: flags.time,
        guests: parseInt(flags.guests)
      });
    
    default:
      console.error(`Unknown dineout action: ${action}`);
      process.exit(1);
  }
}

main();


Security scan verdicts — ClawScan: suspicious | static analysis: suspicious | VirusTotal: clean | SkillSpector: clean (LOW)