{
 "name": "[노드 한 장] MCP Client Tool · 전용 무해 수학 서버",
 "nodes": [
  {
   "id": "server",
   "name": "MCP Server Trigger",
   "type": "@n8n/n8n-nodes-langchain.mcpTrigger",
   "typeVersion": 2.1,
   "position": [
    260,
    0
   ],
   "parameters": {
    "authentication": "none",
    "path": "YOUR_MCP_TEST_PATH"
   }
  },
  {
   "id": "math",
   "name": "calculate_discount_total",
   "type": "@n8n/n8n-nodes-langchain.toolCode",
   "typeVersion": 1.3,
   "position": [
    260,
    240
   ],
   "parameters": {
    "description": "무해한 샘플 할인 계산만 수행합니다. query는 unitPrice, quantity, discountPercent 숫자를 담은 JSON 문자열이어야 합니다. 예: {\"unitPrice\":50000,\"quantity\":3,\"discountPercent\":10}. 반환은 합계 숫자 문자열입니다. 파일·네트워크·개인 데이터 접근이 없습니다.",
    "language": "javaScript",
    "jsCode": "// 직접 작성한 가상 샘플. JSON 숫자를 검증하고 고정 산술만 수행합니다.\nconst p = JSON.parse(query);\nconst unitPrice = Number(p.unitPrice);\nconst quantity = Number(p.quantity);\nconst discountPercent = Number(p.discountPercent);\nif (!Number.isFinite(unitPrice) || unitPrice <= 0 || !Number.isInteger(quantity) || quantity <= 0 || !Number.isFinite(discountPercent) || discountPercent < 0 || discountPercent > 100) {\n  throw new Error('Invalid numeric inputs');\n}\nconst total = unitPrice * quantity * (1 - discountPercent / 100);\nif (!Number.isFinite(total)) throw new Error('Invalid total');\nreturn String(total);",
    "specifyInputSchema": false
   }
  }
 ],
 "connections": {
  "calculate_discount_total": {
   "ai_tool": [
    [
     {
      "node": "MCP Server Trigger",
      "type": "ai_tool",
      "index": 0
     }
    ]
   ]
  }
 },
 "settings": {
  "executionOrder": "v1",
  "timezone": "Asia/Seoul"
 },
 "meta": {
  "templateCredsSetupCompleted": false,
  "source": "datapopcorn.ai/workflow/nodes"
 }
}