{
  "connections": {
    "Find emergency vet (VetAI MCP)": {
      "main": [
        [
          {
            "index": 0,
            "node": "Respond with results",
            "type": "main"
          }
        ]
      ]
    },
    "Webhook": {
      "main": [
        [
          {
            "index": 0,
            "node": "Find emergency vet (VetAI MCP)",
            "type": "main"
          }
        ]
      ]
    }
  },
  "name": "VetAI — Emergency Vet Finder",
  "nodes": [
    {
      "id": "webhook-trigger",
      "name": "Webhook",
      "parameters": {
        "httpMethod": "GET",
        "options": {},
        "path": "vetai-emergency-vet",
        "responseMode": "responseNode"
      },
      "position": [
        240,
        300
      ],
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "webhookId": "vetai-emergency-vet"
    },
    {
      "id": "http-vetai-mcp",
      "name": "Find emergency vet (VetAI MCP)",
      "parameters": {
        "jsonBody": "={\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"tools/call\",\n  \"params\": {\n    \"name\": \"find_emergency_vet\",\n    \"arguments\": {\n      \"location\": \"{{ $json.query.location || 'San Francisco, CA' }}\",\n      \"limit\": 5\n    }\n  }\n}",
        "method": "POST",
        "options": {
          "timeout": 30000
        },
        "sendBody": true,
        "specifyBody": "json",
        "url": "https://usevetai.com/mcp"
      },
      "position": [
        460,
        300
      ],
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2
    },
    {
      "id": "respond-webhook",
      "name": "Respond with results",
      "parameters": {
        "options": {},
        "respondWith": "json",
        "responseBody": "={{ (() => { const t = $json.result && $json.result.content && $json.result.content[0] ? $json.result.content[0].text : ''; try { return { location: $('Webhook').first().json.query.location || 'San Francisco, CA', emergency_vets: JSON.parse(t) }; } catch (e) { return { location: $('Webhook').first().json.query.location || 'San Francisco, CA', emergency_vets_raw: t }; } })() }}"
      },
      "position": [
        680,
        300
      ],
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.1
    },
    {
      "id": "sticky-setup",
      "name": "Sticky Note",
      "parameters": {
        "color": 4,
        "content": "## VetAI — Emergency Vet Finder\n\nCalls the live VetAI MCP server (https://usevetai.com/mcp) to find 24-hour emergency animal hospitals near a location.\n\n### Setup\n1. Activate this workflow (toggle top-right). n8n gives you a production webhook URL.\n2. Call it: `GET <webhook-url>?location=Austin, TX`\n3. The workflow POSTs a JSON-RPC `tools/call` for `find_emergency_vet` to the VetAI MCP endpoint and returns the nearest open-now emergency vets as JSON.\n\n### Notes\n- `location` is optional; defaults to San Francisco, CA.\n- No API key needed — the VetAI MCP server is public and stateless.\n- Tool reference: https://usevetai.com/llms.txt\n- To find regular (non-emergency) vets, duplicate the HTTP node and change the tool name to `find_vets` with arguments `{ \"location\": ..., \"open_now\": true, \"min_rating\": 4.0 }`.",
        "height": 460,
        "width": 420
      },
      "position": [
        160,
        80
      ],
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  }
}
