{
  "id": "aC1k1pYeeq4depUi",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "AI-Powered Natural Language Date Parser with 96% Accuracy",
  "tags": [],
  "nodes": [
    {
      "id": "65d87d2e-6091-4ec2-98d2-589dddec0748",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1000,
        360
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "bf8c983c-ee58-4aae-83be-76196a976f91",
      "name": "AI Agent with Date Parser",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1000,
        140
      ],
      "parameters": {
        "text": "={{ $json.userInput }}",
        "options": {
          "systemMessage": "// PART 1: Developer's Agent Purpose (Customizable)\nYou are a helpful scheduling and planning assistant. Help users with date-related requests, meeting planning, and timeline coordination.\n\nWhen you use the dateParserTool, always format your response in this clean structure:\n\n\ud83c\udfaf **REQUEST:** [User's original request]\n\ud83d\udcc5 **PARSED DATE:** [Start date] to [End date]\n\ud83d\udcca **CONFIDENCE:** [X%] [confidence indicator: \ud83c\udf1f for >90%, \u26a1 for >70%, \u26a0\ufe0f for lower]\n\ud83c\udf0d **TIMEZONE:** [timezone]\n\u23f1\ufe0f **TIMING:** [Any specific time details]\n\ud83d\udca1 **CONTEXT:** [Brief explanation of how the date was interpreted]\n[If ambiguities exist, mention them with suggestions]\n\n// PART 2: Tool Description (Fixed/Standard)\n---\nAVAILABLE TOOLS:\n\ndateParserTool - Advanced natural language date parser that can:\n- Parse quarters (Q1, Q2, Q3, Q4) with specific year support\n- Handle fuzzy date ranges (early/mid/late month)\n- Calculate business days excluding weekends  \n- Process complex patterns (last Friday of March, 2 weeks before Christmas)\n- Interpret relative dates (next week, in 3 months, tomorrow)\n- Handle seasonal references (spring 2025, winter campaign)\n- Detect vague terms and provide guidance (soon, eventually, ASAP)\n- Support multi-year planning and fiscal periods\n- Provide confidence scoring and intelligent explanations\n\nThe tool returns precise date ranges with start/end times, confidence levels, and business context. Use it whenever users mention dates, deadlines, scheduling, or time-related planning.\n\nAlways use the dateParserTool for ANY date, time, or scheduling reference in the user's message. Do not guess or estimate dates - use the tool to get precise results."
        },
        "promptType": "define"
      },
      "typeVersion": 2
    },
    {
      "id": "a1c65f40-fbf7-4f76-a286-6bae182ebe7f",
      "name": "Natural Language Date Parser",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        1220,
        360
      ],
      "parameters": {
        "url": "https://mcp-dateparser.jaredco.com",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"type\": \"call-tool\",\n  \"tool_id\": \"natural_language_date_parser\",\n  \"input\": {\n    \"text\": \"{{ $fromAI('text', 'The date/time text to parse', 'string') }}\"\n  }\n}",
        "sendBody": true,
        "specifyBody": "json",
        "toolDescription": "dateParserTool"
      },
      "typeVersion": 4.2
    },
    {
      "id": "de12c5d2-ffec-4456-8ee8-c2c2f6393977",
      "name": "Set User Input",
      "type": "n8n-nodes-base.set",
      "position": [
        800,
        140
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "userInput",
              "name": "userInput",
              "type": "string",
              "value": "First Monday in July 2025"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "54378fc9-36a6-405d-9581-5dbf32efed5f",
      "name": "Start",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        600,
        140
      ],
      "parameters": {},
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "cd771a77-777a-46bb-99a8-5df040e1b630",
  "connections": {
    "Start": {
      "main": [
        [
          {
            "node": "Set User Input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set User Input": {
      "main": [
        [
          {
            "node": "AI Agent with Date Parser",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent with Date Parser",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Natural Language Date Parser": {
      "ai_tool": [
        [
          {
            "node": "AI Agent with Date Parser",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  }
}