|
| 1 | + |
| 2 | +1. Discovered MCP servers from config file: integration/mcp/../../integration/mcp/mcp_server_discovery.json:{ |
| 3 | + "servers": [ |
| 4 | + { |
| 5 | + "name": "API Logic Server: basic_demo", |
| 6 | + "base_url": "http://localhost:5656", |
| 7 | + "schema_url": "http://localhost:5656/.well-known/mcp.json" |
| 8 | + } |
| 9 | + ] |
| 10 | +} |
| 11 | + |
| 12 | + |
| 13 | +Learnings and Schema from discovery schema_url: http://localhost:5656/.well-known/mcp.json: |
| 14 | +{ |
| 15 | + "base_url": "http://localhost:5656/api", |
| 16 | + "description": "API Logic Project: basic_demo", |
| 17 | + "learning": "To issue one request per row from a prior step (fan-out), use the syntax:\n\n\"$<stepIndex>[*].<fieldName>\"\n\nFor example, if step 0 returns orders, and you want to send a POST per customer:\n\nBefore (incorrect):\n \"customer_id\": \"{customer_id}\"\n\nAfter (correct):\n \"customer_id\": \"$0[*].customer_id\"\n \nOnly if 'email' is in the Natural language query, send email by issing a POST request to the SysEmail endpoint, setting the subject, message and customer_id in the body. DO NOT include a POST unless the word \u2018email\u2019 appears in the user query.\n\nFormat response as mcp_responseFormat.\n\n<mcp_responseFormat>\nclass QueryParam(BaseModel):\n name: str # attribute name\n op: str # eq, lt, gt\n val: str\n\nclass JsonValues(BaseMopdel):\n name: str # name of attribute\n value: str # value of attribute\n\nclass Resource(BaseModel):\n tool_type: str\n base_url: str\n path: str # specified use case or requirement name (use 'General' if missing)\n method: str # GET, PATCH, POST or DELETE\n body: json # data for P |
| 18 | + "resources": |
| 19 | +[ |
| 20 | + { |
| 21 | + "fields": [ |
| 22 | + "id", |
| 23 | + "name", |
| 24 | + "balance", |
| 25 | + "credit_limit", |
| 26 | + "email", |
| 27 | + "email_opt_out" |
| 28 | + ], |
| 29 | + "filterable": [ |
| 30 | +... etc |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | +2a. LLM request: |
| 35 | + |
| 36 | +Natural language query: |
| 37 | + List the orders date_shipped is null and CreatedOn before 2023-07-14, and send a discount email (subject: 'Discount Offer') to the customer for each one. |
| 38 | + |
| 39 | +Learnings_and_Schema: |
| 40 | +{"http://localhost:5656/.well-known/mcp.json": {"base_url": "http://localhost:5656/api", "description": "API Logic Project: basic_demo", "learning": "To issue one request per row from a prior step (fan-out), use the syntax:\n\n\"$<stepIndex>[*].<fieldName>\"\n\nFor example, if step 0 returns orders, and you want to send a POST per customer:\n\nBefore (incorrect):\n \"customer_id\": \"{customer_id}\"\n\nAfter (correct):\n \"customer_id\": \"$0[*].customer_id\"\n \nOnly if 'email' is in the Natural language query, send email by issing a POST request to the SysEmail endpoint, setting the subject, message and customer_id in the body. DO NOT include a POST unless the word \u2018email\u2019 appears in the user query.\n\nFormat response as mcp_responseFormat.\n\n<mcp_responseFormat>\nclass QueryParam(BaseModel):\n name: str # attribute name\n op: str # eq, lt, gt\n val: str\n\nclass JsonValues(BaseMopdel):\n name: str # name of attribute\n value: str # value of attribute\n\nclass Resource(BaseModel):\n tool_type: str\n base_url: str\n path: str # specified use case or requirement name (use 'General' if missing)\n method: str # GET, PATCH, POST or |
| 41 | +... etc from step 1 |
| 42 | + |
| 43 | +2b. generated tool context from LLM: |
| 44 | +{ |
| 45 | + "schema_version": "1.0", |
| 46 | + "resources": [ |
| 47 | + { |
| 48 | + "tool_type": "json-api", |
| 49 | + "base_url": "http://localhost:5656/api", |
| 50 | + "path": "/Order", |
| 51 | + "method": "GET", |
| 52 | + "query_params": [ |
| 53 | + { |
| 54 | + "name": "date_shipped", |
| 55 | + "op": "eq", |
| 56 | + "val": "null" |
| 57 | + }, |
| 58 | + { |
| 59 | + "name": "CreatedOn", |
| 60 | + "op": "lt", |
| 61 | + "val": "2023-07-14" |
| 62 | + } |
| 63 | + ] |
| 64 | + }, |
| 65 | + { |
| 66 | + "tool_type": "json-api", |
| 67 | + "base_url": "http://localhost:5656/api", |
| 68 | + "path": "/SysEmail", |
| 69 | + "method": "POST", |
| 70 | + "body": { |
| 71 | + "subject": "Discount Offer", |
| 72 | + "message": "Dear customer, we are offering a discount on your next purchase. Please check your account for more details.", |
| 73 | + "customer_id": "$0[*].customer_id" |
| 74 | + } |
| 75 | + } |
| 76 | + ] |
| 77 | +} |
| 78 | + |
| 79 | +3. MCP Client Executor – Starting Tool Context Execution |
| 80 | + |
| 81 | + |
| 82 | + |
| 83 | +➡️ MCP execute_api_step[0]: |
| 84 | + Method: GET http://localhost:5656/api/Order |
| 85 | + Query: filter=[{"name": "date_shipped", "op": "eq", "val": null}, {"name": "CreatedOn", "op": "lt", "val": "2023-07-14"}] |
| 86 | + Body: {} |
| 87 | + |
| 88 | +Warning: No Flask request context available. secure API calls may not work as expected. |
| 89 | + |
| 90 | + |
| 91 | +➡️ MCP execute_api_step[1]: |
| 92 | + Method: POST http://localhost:5656/api/SysEmail |
| 93 | + Query: filter=[] |
| 94 | + Body: {'data': {'type': 'SysEmail', 'attributes': {'subject': 'Discount Offer', 'message': 'Dear customer, we are offering a discount on your next purchase. Please check your account for more details.', 'customer_id': 1}}} |
| 95 | + |
| 96 | +Warning: No Flask request context available. secure API calls may not work as expected. |
| 97 | + |
| 98 | + |
| 99 | +➡️ MCP execute_api_step[1]: |
| 100 | + Method: POST http://localhost:5656/api/SysEmail |
| 101 | + Query: filter=[] |
| 102 | + Body: {'data': {'type': 'SysEmail', 'attributes': {'subject': 'Discount Offer', 'message': 'Dear customer, we are offering a discount on your next purchase. Please check your account for more details.', 'customer_id': 3}}} |
| 103 | + |
| 104 | +Warning: No Flask request context available. secure API calls may not work as expected. |
| 105 | + |
| 106 | + |
| 107 | +➡️ MCP execute_api_step[1]: |
| 108 | + Method: POST http://localhost:5656/api/SysEmail |
| 109 | + Query: filter=[] |
| 110 | + Body: {'data': {'type': 'SysEmail', 'attributes': {'subject': 'Discount Offer', 'message': 'Dear customer, we are offering a discount on your next purchase. Please check your account for more details.', 'customer_id': 5}}} |
| 111 | + |
| 112 | +Warning: No Flask request context available. secure API calls may not work as expected. |
| 113 | + |
| 114 | + |
| 115 | +4. MCP Client Executor – Context Results: |
| 116 | + |
| 117 | +Step 0 - Results (3 rows): |
| 118 | +| CreatedOn | amount_total | customer_id | date_shipped | notes | |
| 119 | +|------------|--------------|-------------|--------------|------------------| |
| 120 | +| 2023-02-22 | 90.0 | 1 | None | Second Order | |
| 121 | +| 2023-01-22 | 220.0 | 3 | None | Pending Shipment | |
| 122 | +| 2023-01-22 | 220.0 | 5 | None | Silent Shipment | |
| 123 | + |
| 124 | +Step 1 - Results (1 rows): |
| 125 | +| CreatedOn | customer_id | message | subject | |
| 126 | +|------------|-------------|--------------------------------------------------------------------------------------------------------------|----------------| |
| 127 | +| 2025-07-02 | 1 | Dear customer, we are offering a discount on your next purchase. Please check your account for more details. | Discount Offer | |
| 128 | + |
| 129 | +Step 2 - Results (1 rows): |
| 130 | +| CreatedOn | customer_id | message | subject | |
| 131 | +|------------|-------------|--------------------------------------------------------------------------------------------------------------|----------------| |
| 132 | +| 2025-07-02 | 3 | Dear customer, we are offering a discount on your next purchase. Please check your account for more details. | Discount Offer | |
| 133 | + |
| 134 | +Step 3 - Results (1 rows): |
| 135 | +| CreatedOn | customer_id | message | subject | |
| 136 | +|------------|-------------|--------------------------------------------------------------------------------------------------------------|----------------| |
| 137 | +| 2025-07-02 | 5 | Dear customer, we are offering a discount on your next purchase. Please check your account for more details. | Discount Offer | |
| 138 | + |
| 139 | +✅ MCP Client Executor – All Steps Executed - Review Results Above |
| 140 | +.. 💡 Suggestion - Copy/Paste Response to a JsonFormatter |
| 141 | + |
| 142 | +Test complete. |
0 commit comments