{ "name": "weather-mcp-test", "nodes": [ { "parameters": {}, "type": "n8n-nodes-base.manualTrigger", "typeVersion": 1, "position": [ -200, -40 ], "id": "0f45da70-8aed-4dd8-ba05-9d6aea87dd26", "name": "When clicking ‘Test workflow’" }, { "parameters": { "model": { "__rl": true, "mode": "list", "value": "gpt-4o-mini" }, "options": {} }, "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi", "typeVersion": 1.2, "position": [ 20, 160 ], "id": "649f27c8-de16-44e0-9b12-f5244948902c", "name": "OpenAI Chat Model", "credentials": { "openAiApi": { "id": "53oLIFNTotYXaFye", "name": "OpenAi account" } } }, { "parameters": { "jsCode": "// Loop over input items and add a new field called 'myNewField' to the JSON of each one\nfor (const item of $input.all()) {\n item.json.req = \"what is the current weather in boca raton \";\n}\n\nreturn $input.all();" }, "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ -20, -40 ], "id": "db9e9ec1-05ac-4d89-8eda-385fc26b4e97", "name": "Code" }, { "parameters": { "promptType": "define", "text": "={{ $json.req }}", "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\" → Call weatherTool with location=\"Boca Raton\", query_type=\"current\"\n- \"5 day forecast for Miami\" → 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." } }, "type": "@n8n/n8n-nodes-langchain.agent", "typeVersion": 2, "position": [ 220, -40 ], "id": "81d7c35b-ccc5-4f0d-8f5c-badb15e1f729", "name": "AI Agent" }, { "parameters": { "jsCode": " \n\nreturn $input.all();" }, "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 580, -40 ], "id": "07ffd1d2-2402-4a33-93ed-27af314fde76", "name": "Code1" }, { "parameters": { "toolDescription": "Get weather information for any location - supports current weather, forecasts, and multi-day predictions", "method": "POST", "url": "https://mcp-weathertrax.jaredco.com", "sendBody": true, "specifyBody": "json", "jsonBody": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('JSON', ``, 'json') }}", "options": {} }, "type": "n8n-nodes-base.httpRequestTool", "typeVersion": 4.2, "position": [ 460, 160 ], "id": "015b8eba-207a-4404-984d-37cfd9dfa3d5", "name": "MCP - WeatherTrax" } ], "pinData": {}, "connections": { "When clicking ‘Test workflow’": { "main": [ [ { "node": "Code", "type": "main", "index": 0 } ] ] }, "OpenAI Chat Model": { "ai_languageModel": [ [ { "node": "AI Agent", "type": "ai_languageModel", "index": 0 } ] ] }, "Code": { "main": [ [ { "node": "AI Agent", "type": "main", "index": 0 } ] ] }, "AI Agent": { "main": [ [ { "node": "Code1", "type": "main", "index": 0 } ] ] }, "MCP - WeatherTrax": { "ai_tool": [ [ { "node": "AI Agent", "type": "ai_tool", "index": 0 } ] ] } }, "active": false, "settings": { "executionOrder": "v1" }, "versionId": "bcf55fa7-2990-41cd-b71f-d932ccdcfb6b", "meta": { "templateCredsSetupCompleted": true, "instanceId": "04825daa9471a5540d9cbe929ad35145fdd237d05aa1593716515dbb7e6d5f84" }, "id": "K0TOHqLdUlNv4T9h", "tags": [] }