{
  "id": "DtcpXZZBN3IgksKb",
  "name": "WeatherTrax MCP Agent Demo",
  "tags": [],
  "nodes": [
    {
      "id": "5b4fa064-f1f9-4747-81a1-1d68f477850c",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -280,
        160
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "07d3bb38-9e4e-4054-96f7-f1a47585525b",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -220,
        -60
      ],
      "parameters": {
        "text": "={{ $json['Weather Request'] }}",
        "options": {
          "systemMessage": "\n\nWhen users ask about weather, you MUST call the connected weatherTool function with these exact parameters:\n- location: (string) The city or location name\n- query_type: (string) Either \"current\" for current weather or \"multi_day\" for forecasts\n- num_days: (integer) Number of days for forecast (only when using \"multi_day\")\n\nIMPORTANT: Always use the function call format for weather requests.\n\nExamples:\n- \"Weather in Boca Raton\" \u2192 Call weatherTool with location=\"Boca Raton\", query_type=\"current\"\n- \"5 day forecast for Miami\" \u2192 Call weatherTool with location=\"Miami\", query_type=\"multi_day\", num_days=5\n\nAlways extract the location from the user's request and call the weatherTool function."
        },
        "promptType": "define"
      },
      "typeVersion": 2
    },
    {
      "id": "3b6d46cd-5fd5-4e1b-be6e-ee1d38243a0d",
      "name": "MCP - WeatherTrax",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        -40,
        160
      ],
      "parameters": {
        "url": "https://mcp-weathertrax.jaredco.com",
        "method": "POST",
        "options": {},
        "jsonBody": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('JSON', ``, 'json') }}",
        "sendBody": true,
        "specifyBody": "json",
        "toolDescription": "Get weather information for any location - supports current weather, forecasts, and multi-day predictions"
      },
      "typeVersion": 4.2
    },
    {
      "id": "f85c933c-bbbc-4258-beef-730376bcdd78",
      "name": "\ud83e\uddea View Results Here",
      "type": "n8n-nodes-base.code",
      "position": [
        140,
        -60
      ],
      "parameters": {
        "jsCode": "return [{ fullAgentOutput: $json, toolCall: $json.tool_call, toolParams: $json.tool_call?.input, message: '\u2705 Click this node to view the tool call and parsed input!' }]"
      },
      "typeVersion": 2
    },
    {
      "id": "c6beafa9-b079-4c91-8dde-c9b44c18b155",
      "name": "\ud83e\uddea Enter weather request",
      "type": "n8n-nodes-base.set",
      "position": [
        -440,
        -60
      ],
      "parameters": {
        "values": {
          "string": [
            {
              "name": "Weather Request",
              "value": "What is the weather in New York City?"
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 2
    },
    {
      "id": "027ab837-512d-4fc5-9c5d-b7491e94e57d",
      "name": "When clicking \u2018Execute workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -680,
        -60
      ],
      "parameters": {},
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "a6ff7fde-e347-45e3-8053-a74f9b099a06",
  "connections": {
    "AI Agent": {
      "main": [
        [
          {
            "node": "\ud83e\uddea View Results Here",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "MCP - WeatherTrax": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "\ud83e\uddea Enter weather request": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \u2018Execute workflow\u2019": {
      "main": [
        [
          {
            "node": "\ud83e\uddea Enter weather request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}