tool definitions from MCP Server • Adds them to the prompt • Builds the API Request to the LLM with the list of tools + previous message Quarkus agent { "model" : "gpt-4o-mini", "messages" : [ { "role" : "system", "content" : "You are an expert tool calling, review the user message and call the best matching tool" }, { "role" : "user", "content" : "This is the user request. It contains the customerId and the user request. If you called a tool, add the function name to the response.\nRequest: {\n \"customer_id\" : \"AROUT\",\n \"request\" : \"Hello, I can't find the invoice for my most recent purchase, please send my invoice history. \\n\\nSincerely, \\nThomas \\
[email protected]\"\n}\n\nYou must answer strictly in the following JSON format: {\n\"tools\": (type: array of string),\n\"records\": (type: array of org.parasol.customerservice.finance.ai.model.FinanceRecord: {\n\"id\": (type: integer),\n\"customer\": (type: string),\n\"orderDate\": (type: date string (2023-12-31)),\n\"shippedDate\": (type: date string (2023-12- 31)),\n\"status\": (type: string),\n\"value\": (type: java.math.BigDecimal)\n})\n}" } ], "temperature" : 0.0, "top_p" : 1.0, "presence_penalty" : 0.0, "frequency_penalty" : 0.0, "tools" : [ { "type" : "function", "function" : { "name" : "findMissingReceipt", "description" : "Start the process to find a lost receipt for a customer.", "parameters" : { "type" : "object", "properties" : { "customerId" : { "type" : "string", "description" : "the customer id" } }, "required" : [ "customerId" ] } } }, { "type" : "function", "function" : { "name" : "getInvoiceHistory", "description" : "Retrieve a customer's invoice history based on their customer id.", "parameters" : { "type" : "object", "properties" : { "customerId" : { "type" : "string", "description" : "the customer id" } }, "required" : [ "customerId" ] } } }, { "type" : "function", "function" : { "name" : "getOrderHistory", "description" : "Retrieve a customer's order history based on their customer id.", "parameters" : { "type" : "object", "properties" : { "customerId" : { "type" : "string", "description" : "the customer id" } }, "required" : [ "customerId" ] } } }, { "type" : "function", "function" : { "name" : "startDuplicateChargeDispute", "description" : "Start the process to dispute a duplicate charge for a customer.", "parameters" : { "type" : "object", "properties" : { "customerId" : { "type" : "string", "description" : "the customer id" } }, "required" : [ "customerId" ] } } } ] } System prompt User prompt This is the user request. It contains the customerId and the user request. If you called a tool, add the function name to the response.\nRequest: {\n \"customer_id\" : \"AROUT\",\n \"request\" : \"Hello, I can't find the invoice for my most recent purchase, please send my invoice history. \\n\\nSincerely, \\nThomas \\
[email protected]\"\n}\n\nYou must answer strictly in the following JSON format: {\n\"tools\": (type: array of string),\n\"records\": (type: array of org.parasol.customerservice.finance.ai.model.FinanceR ecord: {\n\"id\": (type: integer),\n\"customer\": (type: string),\n\"orderDate\": (type: date string (2023-12-31)),\n\"shippedDate\": (type: date string (2023-12-31)),\n\"status\": (type: string),\n\"value\": (type: java.math.BigDecimal)\n})\n} Enriched input User prompt