This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch CAMEL-27475-kamelet-data-types
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 460753a2442d0c8e1102867fc498de5612d6b36e
Author: Claus Ibsen <[email protected]>
AuthorDate: Mon Nov 23 17:31:19 2026 +0100

    CAMEL-27475: camel-jbang - show the data type a Kamelet turns the body 
into, at the step that calls it (LinkedHashMap -> json)
    
    A step that calls a Kamelet is reached with the body of the calling route,
    such as the LinkedHashMap of a CSV row, and Camel turns it into the default
    in data type of the Kamelet before the Kamelet sees it: postgresql-sink
    takes json, and application-json writes the Map as JSON. The views now say
    so: LinkedHashMap -> json, or -> json before a message has reached the
    step. A body the transformer does not take, as the catalog says, is marked.
    
    The data type comes from the Kamelet (the project's own Kamelet files, else
    the Kamelet catalog the integration runs), and what its transformer takes
    from the catalog (bodyTypes.transformerIn).
    
    - KameletInput (camel-jbang-core) resolves it; camel cmd route-structure and
      the AI/MCP route structure tool add it to each step as kameletInput
    - the TUI looks the Kamelets up in the background and shows it in the
      Source, Routes and Diagram views, with a quick doc and an Info panel
      that say what the Kamelet takes and why a Map is fine
    - camel-diagram NodeInfo has the kameletInput of a step
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
    Signed-off-by: Claus Ibsen <[email protected]>
---
 .../apache/camel/diagram/RouteDiagramHelper.java   |  17 ++
 .../camel/diagram/RouteDiagramLayoutEngine.java    |  20 ++
 .../org/apache/camel/diagram/RouteErrorFrame.java  |   1 +
 .../camel/diagram/RouteDiagramHelperTest.java      |   8 +-
 .../ROOT/pages/camel-jbang-diagnostics.adoc        |   9 +-
 .../modules/ROOT/pages/camel-jbang-mcp.adoc        |   4 +-
 .../ROOT/pages/camel-jbang-tui-diagram.adoc        |   9 +
 .../ROOT/pages/camel-jbang-tui-source-editor.adoc  |   9 +
 .../commands/action/CamelRouteStructureAction.java |  41 ++-
 .../jbang/core/commands/ai/KameletDefinitions.java |  34 ++-
 .../dsl/jbang/core/commands/ai/KameletInput.java   | 308 +++++++++++++++++++++
 .../dsl/jbang/core/commands/ai/ToolRegistry.java   |  25 +-
 .../action/CamelRouteStructureActionTest.java      |  19 ++
 .../jbang/core/commands/ai/KameletInputTest.java   | 226 +++++++++++++++
 .../dsl/jbang/core/commands/mcp/RuntimeTools.java  |   5 +-
 .../core/commands/tui/DataRefreshService.java      |   2 +
 .../core/commands/tui/DiagramDetailSupport.java    |  31 +++
 .../jbang/core/commands/tui/DiagramTopology.java   |   7 +-
 .../jbang/core/commands/tui/IntegrationInfo.java   |   5 +
 .../dsl/jbang/core/commands/tui/KameletInputs.java | 204 ++++++++++++++
 .../dsl/jbang/core/commands/tui/LiveRunLines.java  |  13 +-
 .../dsl/jbang/core/commands/tui/ProcessorInfo.java |   7 +
 .../dsl/jbang/core/commands/tui/RoutesTab.java     |  10 +-
 .../jbang/core/commands/tui/SourceLiveColumn.java  |  62 ++++-
 .../dsl/jbang/core/commands/tui/SourceTab.java     |   8 +-
 .../dsl/jbang/core/commands/tui/StatusParser.java  |   4 +
 .../commands/tui/diagram/RouteDiagramWidget.java   |  36 ++-
 .../src/main/resources/tui/help/diagram.md         |   4 +-
 .../src/main/resources/tui/help/routes.md          |   2 +-
 .../src/main/resources/tui/help/source.md          |   8 +
 .../jbang/core/commands/tui/KameletInputsTest.java | 254 +++++++++++++++++
 .../tui/diagram/BodyTypesOnArrowsTest.java         |  22 ++
 32 files changed, 1370 insertions(+), 44 deletions(-)

diff --git 
a/components/camel-diagram/src/main/java/org/apache/camel/diagram/RouteDiagramHelper.java
 
b/components/camel-diagram/src/main/java/org/apache/camel/diagram/RouteDiagramHelper.java
index c22f0b78717c..2e810bf33c4a 100644
--- 
a/components/camel-diagram/src/main/java/org/apache/camel/diagram/RouteDiagramHelper.java
+++ 
b/components/camel-diagram/src/main/java/org/apache/camel/diagram/RouteDiagramHelper.java
@@ -19,6 +19,7 @@ package org.apache.camel.diagram;
 import java.util.ArrayList;
 import java.util.LinkedHashSet;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
 
 import org.apache.camel.diagram.RouteDiagramLayoutEngine.NodeInfo;
@@ -84,6 +85,7 @@ public final class RouteDiagramHelper {
                     node.bodyTypes = strings(line.get("bodyTypes"));
                     node.bodyKinds = strings(line.get("bodyKinds"));
                     node.bodyFormats = strings(line.get("bodyFormats"));
+                    node.kameletInput = kameletInput(line.get("kameletInput"));
 
                     if (line.containsKey("statistics")) {
                         JsonObject ls = line.getJsonObject("statistics");
@@ -129,6 +131,21 @@ public final class RouteDiagramHelper {
     }
 
     /** The strings of a JSON array, such as the body types of a step; empty 
when there are none. */
+    /**
+     * The data type the Kamelet a step calls turns the body into, from the 
kameletInput of the route structure that the
+     * Camel CLI adds (CAMEL-27475); null when the line has none.
+     */
+    private static RouteDiagramLayoutEngine.KameletInputInfo 
kameletInput(Object value) {
+        if (!(value instanceof Map<?, ?> m) || !(m.get("dataType") instanceof 
String dataType)) {
+            return null;
+        }
+        return new RouteDiagramLayoutEngine.KameletInputInfo(
+                m.get("kamelet") instanceof String k ? k : null, dataType,
+                m.get("transformer") instanceof String t ? t : null,
+                m.get("description") instanceof String d ? d : null,
+                m.get("takesBody") instanceof Boolean b ? b : null);
+    }
+
     private static List<String> strings(Object array) {
         if (!(array instanceof List<?> list) || list.isEmpty()) {
             return List.of();
diff --git 
a/components/camel-diagram/src/main/java/org/apache/camel/diagram/RouteDiagramLayoutEngine.java
 
b/components/camel-diagram/src/main/java/org/apache/camel/diagram/RouteDiagramLayoutEngine.java
index ecc901995580..a9b9844a967c 100644
--- 
a/components/camel-diagram/src/main/java/org/apache/camel/diagram/RouteDiagramLayoutEngine.java
+++ 
b/components/camel-diagram/src/main/java/org/apache/camel/diagram/RouteDiagramLayoutEngine.java
@@ -337,6 +337,26 @@ public class RouteDiagramLayoutEngine {
          * yaml, text or binary, or the media type as it is. More than one is 
marked as a step of more than one kind is.
          */
         public List<String> bodyFormats = List.of();
+        /**
+         * The data type the Kamelet the step calls turns the body into, such 
as json for postgresql-sink, when the
+         * tooling knows it (kameletInput of the route structure, from the 
Kamelet and the catalog); null otherwise.
+         */
+        public KameletInputInfo kameletInput;
+    }
+
+    /**
+     * The data type a Kamelet turns the body into before its route sees it: 
its default in data type and its data type
+     * transformer.
+     *
+     * @param kamelet     the Kamelet, such as postgresql-sink
+     * @param dataType    the data type, such as json
+     * @param transformer the data type transformer, such as application-json
+     * @param description what the Kamelet takes, as its data type describes 
it, or null
+     * @param takesBody   whether the transformer takes the bodies the step 
was reached with: false when the catalog
+     *                    says it does not, null when it is not known or no 
message reached the step
+     */
+    public record KameletInputInfo(
+            String kamelet, String dataType, String transformer, String 
description, Boolean takesBody) {
     }
 
     public static class RouteInfo {
diff --git 
a/components/camel-diagram/src/main/java/org/apache/camel/diagram/RouteErrorFrame.java
 
b/components/camel-diagram/src/main/java/org/apache/camel/diagram/RouteErrorFrame.java
index 55fad6643be5..df64002a8071 100644
--- 
a/components/camel-diagram/src/main/java/org/apache/camel/diagram/RouteErrorFrame.java
+++ 
b/components/camel-diagram/src/main/java/org/apache/camel/diagram/RouteErrorFrame.java
@@ -90,6 +90,7 @@ public record RouteErrorFrame(int topY, int bottomY, 
List<String> lines) {
         copy.bodyTypes = n.bodyTypes;
         copy.bodyKinds = n.bodyKinds;
         copy.bodyFormats = n.bodyFormats;
+        copy.kameletInput = n.kameletInput;
         return copy;
     }
 
diff --git 
a/components/camel-diagram/src/test/java/org/apache/camel/diagram/RouteDiagramHelperTest.java
 
b/components/camel-diagram/src/test/java/org/apache/camel/diagram/RouteDiagramHelperTest.java
index eb6f3d78f6a8..05c6129251d9 100644
--- 
a/components/camel-diagram/src/test/java/org/apache/camel/diagram/RouteDiagramHelperTest.java
+++ 
b/components/camel-diagram/src/test/java/org/apache/camel/diagram/RouteDiagramHelperTest.java
@@ -38,7 +38,8 @@ class RouteDiagramHelperTest {
                    "bodyTypes": 
["org.apache.camel.converter.stream.ByteArrayInputStreamCache"], "bodyKinds": 
["payload"]},
                   {"type": "to", "id": "to1", "level": 1, "code": 
"to[file:outbox]",
                    "bodyTypes": ["byte[]", "java.util.LinkedHashMap"], 
"bodyKinds": ["payload", "data"],
-                   "bodyFormats": ["json"]}]}]}
+                   "bodyFormats": ["json"], "kameletInput": {"kamelet": 
"postgresql-sink", "dataType": "json",
+                     "transformer": "application-json", "takesBody": true}}]}]}
                 """, (JsonObject) null);
 
         RouteInfo route = RouteDiagramHelper.parseRoutes(structure).get(0);
@@ -54,6 +55,11 @@ class RouteDiagramHelperTest {
         assertThat(to.bodyKinds).containsExactly("payload", "data");
         assertThat(to.bodyFormats).containsExactly("json");
         assertThat(route.nodes.get(2).bodyFormats).isEmpty();
+        // the data type the Kamelet the step calls turns the body into 
(CAMEL-27475)
+        assertThat(to.kameletInput.dataType()).isEqualTo("json");
+        assertThat(to.kameletInput.kamelet()).isEqualTo("postgresql-sink");
+        assertThat(to.kameletInput.takesBody()).isTrue();
+        assertThat(route.nodes.get(2).kameletInput).isNull();
     }
 
     @Test
diff --git a/docs/user-manual/modules/ROOT/pages/camel-jbang-diagnostics.adoc 
b/docs/user-manual/modules/ROOT/pages/camel-jbang-diagnostics.adoc
index 7adc25391e5f..fd1e26d6dcc5 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-jbang-diagnostics.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-jbang-diagnostics.adoc
@@ -261,8 +261,15 @@ of the catalog: `json`, `xml`, `csv`, `yaml`, `text` or 
`binary`, or the media t
 example `body: byte[] · json` after a Kamelet with the `json` data type, where 
the type alone does not tell what the
 bytes hold. A step reached with more than one format, such as `body: String · 
xml | csv`, is shown by `--varied` too.
 
+A step that calls a Kamelet shows the data type the Kamelet takes, which Camel 
turns the body into before the Kamelet
+sees it: `body: LinkedHashMap → json` for `postgresql-sink`, whose data type 
transformer writes the `Map` as JSON, or
+`body: → json` before a message has reached it. A body the transformer does 
not take, as the catalog says, reads
+`→ text (text-plain does not take it)`. The Kamelets are looked up in the 
project directory, where the command runs,
+and in the Kamelet catalog of the Camel CLI.
+
 The JSON output (`--json`) has the types, kinds and formats of each step as 
`bodyTypes`, `bodyKinds` and
-`bodyFormats`. The route console of a
+`bodyFormats`, and the data type of the Kamelet a step calls as `kameletInput` 
(`dataType`, `transformer`,
+`description`, `carriers` and `takesBody`). The route console of a
 running integration counts them per route: `variedBodyTypes` and 
`mixedBodyKinds` (the steps that need attention). See
 xref:components:eips:message-history.adoc[Message History] for what the kinds 
mean.
 
diff --git a/docs/user-manual/modules/ROOT/pages/camel-jbang-mcp.adoc 
b/docs/user-manual/modules/ROOT/pages/camel-jbang-mcp.adoc
index 6e3c52128124..2fd9eee44631 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-jbang-mcp.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-jbang-mcp.adoc
@@ -920,7 +920,9 @@ accept `nameOrPid`). A call that names the integration with 
another argument the
   routes when omitted). `brief=true` leaves out the options and expressions. 
With the message history on, each step has
   the body types it has been reached with (`bodyTypes`) and their kinds 
(`bodyKinds`: `null`, `payload`, `data` or
   `collection`), and the formats of the payloads from their `Content-Type` 
(`bodyFormats`: `json`, `xml`, `csv`,
-  `yaml`, `text`, `binary` or the media type), to compare with the format the 
catalog says a step takes;
+  `yaml`, `text`, `binary` or the media type), to compare with the format the 
catalog says a step takes, and for a
+  step that calls a Kamelet the data type the Kamelet turns the body into 
(`kameletInput`, with `takesBody` false when
+  its transformer does not take the body);
   `varied=true` keeps only the steps reached with more than one body type or 
format.
 
 | `camel_runtime_processor_detail`
diff --git a/docs/user-manual/modules/ROOT/pages/camel-jbang-tui-diagram.adoc 
b/docs/user-manual/modules/ROOT/pages/camel-jbang-tui-diagram.adoc
index 780f4e60a4aa..041f6d8ff685 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-jbang-tui-diagram.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-jbang-tui-diagram.adoc
@@ -313,6 +313,15 @@ of the catalog: `byte[] · json` (`json`, `xml`, `csv`, 
`yaml`, `text`, `binary`
 `LinkedHashMap` that reaches a step that takes `json` is easy to spot. A step 
reached with more than one format, such
 as `⚠ String · xml | csv`, is marked as a step of more than one kind is.
 
+A step that calls a Kamelet (`to: kamelet:postgresql-sink`) also shows the 
data type the Kamelet takes: its default
+`in` data type, which Camel turns the body into before the Kamelet sees it. 
For example `LinkedHashMap → json`:
+`postgresql-sink` takes a JSON object, and its data type transformer 
(`application-json`) writes the `Map` as JSON, so
+the step is fine. Kamelets come from event-driven and serverless integration, 
where the data between the steps is
+JSON, which is why a SQL sink takes JSON. Before a message has reached the 
step, it shows what the Kamelet takes
+(`→ json`). A body the transformer does not take, as the Camel catalog says, 
is marked:
+`⚠ ArrayList → text (text-plain does not take it)`. The Kamelets are looked up 
in the project and in the Kamelet
+catalog the integration runs (`camel run --kamelets-version`). The Info panel 
of the step says what the Kamelet takes.
+
 In the topology, the Info panel of a route says how many of its steps were 
reached with more than one type
 (`⚠ 1 mixed · 2 varied`), and the Routes tab has the same in its BODY TYPES 
column, with the types of each step in the
 table of the processors of the selected route. The source view of the Source 
tab has them at the end of the line of each
diff --git 
a/docs/user-manual/modules/ROOT/pages/camel-jbang-tui-source-editor.adoc 
b/docs/user-manual/modules/ROOT/pages/camel-jbang-tui-source-editor.adoc
index d9141588a5c0..ca5be65fb9eb 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-jbang-tui-source-editor.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-jbang-tui-source-editor.adoc
@@ -67,6 +67,15 @@ A payload (text, bytes, a stream or a file) with a 
`Content-Type` header has its
 of the catalog: `byte[] · json` (`json`, `xml`, `csv`, `yaml`, `text`, 
`binary`, or the media type as it is). A step
 reached with more than one format, such as `⚠ String · xml | csv`, is marked 
as a step of more than one kind is.
 
+A step that calls a Kamelet (`to: kamelet:postgresql-sink`) also shows the 
data type the Kamelet takes: its default
+`in` data type, which Camel turns the body into before the Kamelet sees it. 
For example `LinkedHashMap → json`:
+`postgresql-sink` takes a JSON object, and its data type transformer 
(`application-json`) writes the `Map` as JSON, so
+the step is fine. Kamelets come from event-driven and serverless integration, 
where the data between the steps is
+JSON, which is why a SQL sink takes JSON. Before a message has reached the 
step, it shows what the Kamelet takes
+(`→ json`). A body the transformer does not take, as the Camel catalog says, 
is marked:
+`⚠ ArrayList → text (text-plain does not take it)`. The Kamelets are looked up 
in the project and in the Kamelet
+catalog the integration runs (`camel run --kamelets-version`). The quick 
documentation of the line says what the Kamelet takes, and why.
+
 image::jbang/camel-tui-source-body-types.png[The orders route in the source 
view: the steps after the choice are reached with a map and a stream, as only 
one branch marshals, so they have a warning in the gutter, and the quick 
documentation of the selected line says why]
 
 The same body types are in the Routes and Diagram tabs (see
diff --git 
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/action/CamelRouteStructureAction.java
 
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/action/CamelRouteStructureAction.java
index f742376fea4d..5c1a6f7d8b70 100644
--- 
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/action/CamelRouteStructureAction.java
+++ 
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/action/CamelRouteStructureAction.java
@@ -22,6 +22,7 @@ import java.nio.file.Path;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Map;
 import java.util.Objects;
 import java.util.StringJoiner;
 
@@ -29,8 +30,10 @@ import org.aesh.command.CommandDefinition;
 import org.aesh.command.option.Argument;
 import org.aesh.command.option.Mixin;
 import org.aesh.command.option.Option;
+import org.apache.camel.catalog.DefaultCamelCatalog;
 import org.apache.camel.dsl.jbang.core.commands.Run;
 import org.apache.camel.dsl.jbang.core.commands.TransformJavaRoutes;
+import org.apache.camel.dsl.jbang.core.commands.ai.KameletInput;
 import org.apache.camel.dsl.jbang.core.common.CliException;
 import org.apache.camel.dsl.jbang.core.common.CommandLineHelper;
 import org.apache.camel.dsl.jbang.core.common.CompletionCandidates;
@@ -136,6 +139,13 @@ public class CamelRouteStructureAction extends 
ActionBaseCommand {
             // no running integration with the name, so it is a source file
             jo = doCallSource(name);
         }
+        if (!raw && jo.toJson().contains("kamelet")) {
+            // the data type each Kamelet turns the body into (CAMEL-27475), 
from the Kamelets of the project, which is
+            // where the command runs, or of the catalog
+            File source = new File(name);
+            Path directory = source.isFile() ? 
source.getAbsoluteFile().toPath().getParent() : Path.of("");
+            KameletInput.addTo(jo, directory.toAbsolutePath(), new 
DefaultCamelCatalog(true));
+        }
         if (varied) {
             jo = onlyVaried(jo);
             JsonArray routes = jo.getCollection("routes");
@@ -208,6 +218,7 @@ public class CamelRouteStructureAction extends 
ActionBaseCommand {
                     code.bodyTypes = line.getCollection("bodyTypes");
                     code.bodyKinds = line.getCollection("bodyKinds");
                     code.bodyFormats = line.getCollection("bodyFormats");
+                    code.kameletInput = line.getMap("kameletInput");
                     if (brief) {
                         // make code brief
                         code.code = StringHelper.before(code.code, "[", 
code.code);
@@ -296,7 +307,7 @@ public class CamelRouteStructureAction extends 
ActionBaseCommand {
             // the body types each step was reached with, as the running app 
has seen them, line up in a column after
             // the code (the message history records them, such as with camel 
run --dev)
             int width = 0;
-            if (!raw && row.code.stream().anyMatch(code -> code.bodyTypes != 
null && !code.bodyTypes.isEmpty())) {
+            if (!raw && row.code.stream().anyMatch(code -> 
!bodyText(code).isEmpty())) {
                 for (Code code : row.code) {
                     width = Math.max(width, 
StringHelper.padString(code.level).length() + clippedCode(code).length());
                 }
@@ -309,9 +320,9 @@ public class CamelRouteStructureAction extends 
ActionBaseCommand {
                     printer().printf("%s%s%n", pad, c);
                 } else {
                     String text = pad + c;
-                    if (width > 0 && code.bodyTypes != null && 
!code.bodyTypes.isEmpty()) {
-                        text = String.format("%-" + width + "s   body: %s", 
text,
-                                bodyTypes(code.bodyTypes, code.bodyKinds, 
code.bodyFormats));
+                    String body = width > 0 ? bodyText(code) : "";
+                    if (!body.isEmpty()) {
+                        text = String.format("%-" + width + "s   body: %s", 
text, body);
                     }
                     if (code.line != -1) {
                         printer().printf("%4d: %s%n", code.line, text);
@@ -328,6 +339,27 @@ public class CamelRouteStructureAction extends 
ActionBaseCommand {
         return StringHelper.limitLength(Jsoner.unescape(code.code), 90, " 
(clipped)");
     }
 
+    /**
+     * The body column of a step: its body types, and the data type the 
Kamelet it calls turns the body into
+     * ({@code LinkedHashMap → json}, or {@code → json} before a message has 
reached it); empty when it has neither.
+     */
+    private static String bodyText(Code code) {
+        return bodyText(code.bodyTypes, code.bodyKinds, code.bodyFormats, 
code.kameletInput);
+    }
+
+    static String bodyText(
+            List<String> bodyTypes, List<String> bodyKinds, List<String> 
bodyFormats,
+            Map<String, Object> in) {
+        String types = bodyTypes != null && !bodyTypes.isEmpty() ? 
bodyTypes(bodyTypes, bodyKinds, bodyFormats) : "";
+        if (in == null || in.get("dataType") == null) {
+            return types;
+        }
+        Object takes = in.get("takesBody");
+        String arrow = KameletInput.arrowText((String) in.get("dataType"), 
takes instanceof Boolean b ? b : null,
+                (String) in.get("transformer"));
+        return types.isEmpty() ? arrow : types + " " + arrow;
+    }
+
     /**
      * The body types by their simple class names, such as {@code String | 
LinkedHashMap} for a step reached with a text
      * by some messages and with a Map by others, followed by the formats of 
the payloads from their Content-Type
@@ -434,5 +466,6 @@ public class CamelRouteStructureAction extends 
ActionBaseCommand {
         List<String> bodyTypes;
         List<String> bodyKinds;
         List<String> bodyFormats;
+        Map<String, Object> kameletInput;
     }
 }
diff --git 
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ai/KameletDefinitions.java
 
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ai/KameletDefinitions.java
index f560faa0c6e1..591e78583c2f 100644
--- 
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ai/KameletDefinitions.java
+++ 
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ai/KameletDefinitions.java
@@ -106,17 +106,41 @@ public final class KameletDefinitions {
         return def != null ? def : catalog().get(name);
     }
 
+    /**
+     * The Kamelet of the project directory, else of the catalog of the given 
version, such as the one a running
+     * integration uses (camel run --kamelets-version), or null.
+     *
+     * @param version the version of the Kamelet catalog, or null for the one 
of the Camel CLI
+     */
+    public static Definition find(String name, Path directory, String version) 
{
+        if (name == null || name.isBlank()) {
+            return null;
+        }
+        Definition def = directory != null ? 
projectKamelets(directory).get(name) : null;
+        return def != null ? def : catalog(version).get(name);
+    }
+
     /** The Kamelets of the catalog by name; empty when the catalog cannot be 
read (offline, say). */
     public static Map<String, Definition> catalog() {
+        return catalog(null);
+    }
+
+    /**
+     * The Kamelets of the catalog of a version by name; empty when the 
catalog cannot be read (offline, say).
+     *
+     * @param version the version, or null for the one of the Camel CLI
+     */
+    public static Map<String, Definition> catalog(String version) {
         Map<String, Definition> fixed = testCatalog;
         if (fixed != null) {
             return fixed;
         }
-        String version;
-        try {
-            version = VersionHelper.extractKameletsVersion();
-        } catch (Exception e) {
-            version = null;
+        if (version == null || version.isBlank()) {
+            try {
+                version = VersionHelper.extractKameletsVersion();
+            } catch (Exception e) {
+                version = null;
+            }
         }
         if (version == null) {
             return Map.of();
diff --git 
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ai/KameletInput.java
 
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ai/KameletInput.java
new file mode 100644
index 000000000000..855387a8012c
--- /dev/null
+++ 
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ai/KameletInput.java
@@ -0,0 +1,308 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.dsl.jbang.core.commands.ai;
+
+import java.nio.file.Path;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+
+import org.apache.camel.catalog.CamelCatalog;
+import org.apache.camel.dsl.jbang.run.catalog.KameletDataTypeModel;
+import org.apache.camel.tooling.model.BodyTypeModel;
+import org.apache.camel.tooling.model.TransformerModel;
+import org.apache.camel.util.json.JsonArray;
+import org.apache.camel.util.json.JsonObject;
+import org.apache.camel.util.json.Jsoner;
+
+/**
+ * The data type a Kamelet turns the body into before its route sees it 
(CAMEL-27475): the default {@code in} data type
+ * of the Kamelet ({@code spec.dataTypes}), which Camel applies as the input 
type of the route of the Kamelet, and what
+ * the data type transformer takes, as the catalog says.
+ * <p>
+ * A step that calls a Kamelet is reached with the body of the calling route, 
such as a {@code LinkedHashMap}, and the
+ * Kamelet gets it as its data type, such as JSON: {@code postgresql-sink} 
takes {@code json}, and its transformer
+ * ({@code application-json}) writes a Map, a List or a POJO as JSON. Kamelets 
come from event-driven and serverless
+ * integration (Knative, CloudEvents), where the data between the steps is 
JSON, which is why a SQL sink takes JSON. A
+ * Camel developer does not know this from the Kamelet's name, and the body 
types alone look as if a Map goes into a
+ * sink that takes JSON, so the tools show the conversion at the step.
+ *
+ * @param kamelet     the name of the Kamelet
+ * @param dataType    the name of the data type, as the Kamelet names it: 
json, text, binary
+ * @param transformer the data type transformer, as the Kamelet names it (its 
format): application-json, text-plain
+ * @param mediaType   the media type of the data type, or null
+ * @param description what the Kamelet takes, as its data type describes it, 
or null
+ * @param carriers    the kinds of Java objects the transformer takes (text, 
bytes, stream, map, pojo...), as the
+ *                    catalog says; empty when the catalog does not know the 
transformer
+ * @param takes       what the transformer takes in words, as the catalog 
says, or null
+ */
+public record KameletInput(
+        String kamelet, String dataType, String transformer, String mediaType, 
String description,
+        List<String> carriers, String takes) {
+
+    public KameletInput {
+        carriers = carriers != null ? List.copyOf(carriers) : List.of();
+    }
+
+    /**
+     * The name of the Kamelet a uri calls, such as postgresql-sink of {@code 
kamelet:postgresql-sink?serverName=db} or
+     * {@code kamelet://postgresql-sink}; null when the uri does not call a 
Kamelet, or names it dynamically.
+     */
+    public static String kameletName(String uri) {
+        if (uri == null) {
+            return null;
+        }
+        String name = uri.trim();
+        if (!name.startsWith("kamelet:")) {
+            return null;
+        }
+        name = name.substring("kamelet:".length());
+        if (name.startsWith("//")) {
+            name = name.substring(2);
+        }
+        int end = name.length();
+        for (char c : new char[] { '?', '/' }) {
+            int i = name.indexOf(c);
+            if (i >= 0) {
+                end = Math.min(end, i);
+            }
+        }
+        name = name.substring(0, end).trim();
+        // kamelet:source and kamelet:sink are the ends of the route of a 
Kamelet, and a placeholder is not known here
+        if (name.isEmpty() || "source".equals(name) || "sink".equals(name) || 
name.contains("{{")
+                || name.contains("${")) {
+            return null;
+        }
+        return name;
+    }
+
+    /**
+     * The data type the Kamelet a uri calls turns the body into, from the 
project's Kamelets and else the catalog.
+     *
+     * @param  uri       the uri of the step, such as kamelet:postgresql-sink
+     * @param  directory the directory of the project, for its own Kamelets, 
or null
+     * @param  catalog   the catalog, for what the transformer takes, or null
+     * @return           the data type, or null when the uri does not call a 
Kamelet, the Kamelet is not known, or it
+     *                   has no default in data type (it gets the body as it 
is)
+     */
+    public static KameletInput find(String uri, Path directory, CamelCatalog 
catalog) {
+        String name = kameletName(uri);
+        KameletDefinitions.Definition def = name != null ? 
KameletDefinitions.find(name, directory, null) : null;
+        return def != null ? of(def, catalog) : null;
+    }
+
+    /**
+     * The default in data type of a Kamelet, with what its transformer takes 
as the catalog says; null when it has
+     * none.
+     */
+    public static KameletInput of(KameletDefinitions.Definition def, 
CamelCatalog catalog) {
+        for (KameletDataTypeModel dt : def.dataTypes()) {
+            if ("in".equals(dt.direction) && dt.defaultType && dt.format != 
null) {
+                TransformerModel transformer = catalog != null
+                        ? 
catalog.transformerModel(CatalogDocs.transformerName(dt.format)) : null;
+                BodyTypeModel in = transformer != null ? 
transformer.getBodyType(BodyTypeModel.TRANSFORMER_IN) : null;
+                return new KameletInput(
+                        def.name(), dt.name, dt.format, dt.mediaType, 
dt.description,
+                        in != null ? in.getCarriers() : List.of(), in != null 
? in.getDescription() : null);
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Whether the transformer takes the bodies a step has been reached with: 
false only when the catalog says it does
+     * not take one of them, such as a List for text-plain; null when it is 
not known, such as for a class the catalog
+     * has no name for.
+     *
+     * @param types the class names of the bodies, as the body-type console 
gives them ("null" for no body)
+     * @param kinds the kinds of the bodies: null, payload, data or collection
+     */
+    public Boolean takes(List<String> types, List<String> kinds) {
+        if (carriers.isEmpty() || types == null || types.isEmpty()) {
+            return null;
+        }
+        if (carriers.contains("any")) {
+            return true;
+        }
+        // the kind of each type is known when they are all of one kind
+        String kind = kinds != null && kinds.size() == 1 ? kinds.get(0) : null;
+        boolean known = true;
+        for (String type : types) {
+            String carrier = carrierOf(type, kind);
+            if (carrier == null) {
+                known = false;
+            } else if (!carriers.contains(carrier)) {
+                return false;
+            }
+        }
+        return known ? Boolean.TRUE : null;
+    }
+
+    /**
+     * The carrier of a body by its class name, as the catalog names them 
(text, bytes, stream, file, value, map, list,
+     * iterator, pojo, null); null when it is not known, such as for a class 
of a library that could be a stream or not.
+     */
+    static String carrierOf(String type, String kind) {
+        if ("null".equals(type)) {
+            return "null";
+        }
+        String carrier = BodyTypeModel.carrierOf(type);
+        if (!"pojo".equals(carrier) && !"unknown".equals(carrier)) {
+            return carrier;
+        }
+        if ("payload".equals(kind)) {
+            // the stream caches of Camel (ByteArrayInputStreamCache, 
ReaderCache...) and the streams of the JDK
+            String simple = type.substring(type.lastIndexOf('.') + 1);
+            if (simple.endsWith("InputStream") || simple.endsWith("Reader") || 
simple.endsWith("Cache")) {
+                return "stream";
+            }
+            if (simple.endsWith("GenericFile")) {
+                return "file";
+            }
+            return null;
+        }
+        if ("data".equals(kind)) {
+            // a Map of a library (a JsonObject) or an object: the 
transformers that take data take both
+            return type.endsWith("Map") || type.endsWith("JsonObject") ? "map" 
: "pojo";
+        }
+        if ("collection".equals(kind)) {
+            return type.endsWith("Iterator") ? "iterator" : "list";
+        }
+        return null;
+    }
+
+    /**
+     * Adds the data type of the Kamelet each step calls to the step, as 
{@code kameletInput}, in the output of the
+     * route-structure console: for {@code to: kamelet:name} and the kamelet 
EIP, when the Kamelet has a default in data
+     * type. With the body types the step has been reached with, {@code 
takesBody} says whether its transformer takes
+     * them (false only when the catalog says it does not).
+     *
+     * @param  routeStructure the output of the route-structure console
+     * @param  directory      the directory of the project, for its own 
Kamelets, or null
+     * @param  catalog        the catalog, for what the transformers take, or 
null
+     * @return                how many steps got a kameletInput
+     */
+    public static int addTo(JsonObject routeStructure, Path directory, 
CamelCatalog catalog) {
+        JsonArray routes = routeStructure != null ? 
routeStructure.getCollection("routes") : null;
+        if (routes == null) {
+            return 0;
+        }
+        Map<String, Optional<KameletInput>> known = new HashMap<>();
+        int count = 0;
+        for (Object r : routes) {
+            List<JsonObject> lines = r instanceof JsonObject route ? 
route.getCollection("code") : null;
+            if (lines == null) {
+                continue;
+            }
+            for (int i = 2; i < lines.size(); i++) {
+                JsonObject line = lines.get(i);
+                String name = kameletName(stepUri(line));
+                if (name == null) {
+                    continue;
+                }
+                KameletInput in = known.computeIfAbsent(name, n -> {
+                    KameletDefinitions.Definition def = 
KameletDefinitions.find(n, directory);
+                    return Optional.ofNullable(def != null ? of(def, catalog) 
: null);
+                }).orElse(null);
+                if (in != null) {
+                    List<String> types = line.getCollection("bodyTypes");
+                    List<String> kinds = line.getCollection("bodyKinds");
+                    line.put("kameletInput", in.toJson(in.takes(types, 
kinds)));
+                    count++;
+                }
+            }
+        }
+        return count;
+    }
+
+    /**
+     * The uri a step of the route structure calls: its endpoint, or 
kamelet:name for the kamelet EIP, whose code is
+     * kamelet[name].
+     */
+    static String stepUri(JsonObject line) {
+        String uri = line.getString("uri");
+        if (uri != null) {
+            return Jsoner.unescape(uri);
+        }
+        String code = line.getString("code");
+        if ("kamelet".equals(line.getString("type")) && code != null && 
code.startsWith("kamelet[")
+                && code.endsWith("]")) {
+            return "kamelet:" + 
Jsoner.unescape(code.substring("kamelet[".length(), code.length() - 1));
+        }
+        return null;
+    }
+
+    /**
+     * The data type in words after the body types of a step: "→ json", and 
why it needs attention when the transformer
+     * does not take the body: "→ text (text-plain does not take it)".
+     */
+    public static String arrowText(String dataType, Boolean takes, String 
transformer) {
+        String answer = "→ " + dataType;
+        if (Boolean.FALSE.equals(takes)) {
+            answer += " (" + transformer + " does not take it)";
+        }
+        return answer;
+    }
+
+    /**
+     * What the transformer takes, in the words a Camel developer knows: 
"text, bytes, a stream, a Map, a List, a POJO
+     * or no body"; null when the catalog does not know the transformer.
+     */
+    public String carriersInWords() {
+        if (carriers.isEmpty()) {
+            return null;
+        }
+        List<String> words = carriers.stream().map(c -> switch (c) {
+            case "stream" -> "a stream";
+            case "file" -> "a file";
+            case "value" -> "a value (number, boolean)";
+            case "map" -> "a Map";
+            case "list" -> "a List";
+            case "iterator" -> "an Iterator";
+            case "pojo" -> "a POJO";
+            case "null" -> "no body";
+            case "any" -> "any body";
+            default -> c;
+        }).toList();
+        if (words.size() == 1) {
+            return words.get(0);
+        }
+        return String.join(", ", words.subList(0, words.size() - 1)) + " or " 
+ words.get(words.size() - 1);
+    }
+
+    /** As JSON, for the route-structure output of the CLI and the MCP tools: 
the step's kameletInput. */
+    public JsonObject toJson(Boolean takes) {
+        JsonObject jo = new JsonObject();
+        jo.put("kamelet", kamelet);
+        jo.put("dataType", dataType);
+        jo.put("transformer", transformer);
+        if (mediaType != null) {
+            jo.put("mediaType", mediaType);
+        }
+        if (description != null) {
+            jo.put("description", description);
+        }
+        if (!carriers.isEmpty()) {
+            jo.put("carriers", new JsonArray(carriers));
+        }
+        if (takes != null) {
+            jo.put("takesBody", takes);
+        }
+        return jo;
+    }
+}
diff --git 
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ai/ToolRegistry.java
 
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ai/ToolRegistry.java
index 69b0695c9b15..eaa6f8b2dd20 100644
--- 
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ai/ToolRegistry.java
+++ 
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ai/ToolRegistry.java
@@ -309,7 +309,10 @@ public final class ToolRegistry {
                                              + " kind needs attention: a step 
that writes fails for data, one that reads"
                                              + " fields fails for a payload. 
bodyFormats: the format of the payload from"
                                              + " its Content-Type (json, xml, 
csv, yaml, text, binary or the media type), to"
-                                             + " compare with the format the 
catalog says a step takes.")
+                                             + " compare with the format the 
catalog says a step takes. kameletInput:"
+                                             + " the data type a Kamelet the 
step calls turns the body into, such as"
+                                             + " json for postgresql-sink, 
which writes a Map as JSON; takesBody false"
+                                             + " when its transformer does not 
take the body.")
                 .param("routeId", "string", "Route ID or pattern such as 
orders* to inspect (use * for all routes)",
                         false)
                 .param("brief", "boolean", "Only the overall structure, 
without the options and expressions", false)
@@ -321,6 +324,7 @@ public final class ToolRegistry {
                         root.put("filter", routeFilter(routeId));
                         root.put("brief", String.valueOf(brief));
                     });
+                    result = withKameletInputs(result, ctx);
                     if ("true".equalsIgnoreCase(args.get("varied"))) {
                         result = onlyVaried(result);
                     }
@@ -1257,6 +1261,25 @@ public final class ToolRegistry {
         return routeId != null && !routeId.isBlank() ? routeId : "*";
     }
 
+    /**
+     * The route structure with the data type each Kamelet a step calls turns 
the body into (kameletInput, CAMEL-27475),
+     * from the Kamelets of the project directory or of the catalog; as it is 
when it is not JSON or calls no Kamelet.
+     */
+    static String withKameletInputs(String routeStructure, ToolContext ctx) {
+        if (routeStructure == null || !routeStructure.contains("kamelet")) {
+            return routeStructure;
+        }
+        try {
+            if (Jsoner.deserialize(routeStructure) instanceof JsonObject jo
+                    && KameletInput.addTo(jo, ctx.defaultDirectory(), 
ctx.catalog()) > 0) {
+                return jo.toJson();
+            }
+        } catch (Exception e) {
+            LOG.debug("Cannot add the data types of the Kamelets to the route 
structure: {}", e.getMessage(), e);
+        }
+        return routeStructure;
+    }
+
     /**
      * The route structure with only the steps reached with more than one body 
type, or a message that says there are
      * none (and why there may be none).
diff --git 
a/dsl/camel-jbang/camel-jbang-core/src/test/java/org/apache/camel/dsl/jbang/core/commands/action/CamelRouteStructureActionTest.java
 
b/dsl/camel-jbang/camel-jbang-core/src/test/java/org/apache/camel/dsl/jbang/core/commands/action/CamelRouteStructureActionTest.java
index 12ef9f1ef87b..fa54dcc2d294 100644
--- 
a/dsl/camel-jbang/camel-jbang-core/src/test/java/org/apache/camel/dsl/jbang/core/commands/action/CamelRouteStructureActionTest.java
+++ 
b/dsl/camel-jbang/camel-jbang-core/src/test/java/org/apache/camel/dsl/jbang/core/commands/action/CamelRouteStructureActionTest.java
@@ -17,6 +17,7 @@
 package org.apache.camel.dsl.jbang.core.commands.action;
 
 import java.util.List;
+import java.util.Map;
 import java.util.function.Consumer;
 
 import org.apache.camel.dsl.jbang.core.commands.CamelJBangMain;
@@ -187,6 +188,24 @@ class CamelRouteStructureActionTest extends 
ActionCommandTestSupport {
                         List.of("payload", "data"), List.of("xml", "csv")));
     }
 
+    @Test
+    void testTheDataTypeOfTheKameletAStepCalls() {
+        // CAMEL-27475: the Map of a row becomes the JSON that postgresql-sink 
takes
+        Map<String, Object> json = Map.of("dataType", "json", "transformer", 
"application-json", "takesBody", true);
+        assertEquals("LinkedHashMap → json", 
CamelRouteStructureAction.bodyText(
+                List.of("java.util.LinkedHashMap"), List.of("data"), null, 
json));
+        // not reached yet: the data type alone
+        assertEquals("→ json", CamelRouteStructureAction.bodyText(null, null, 
null,
+                Map.of("dataType", "json", "transformer", 
"application-json")));
+        // a body the transformer does not take
+        assertEquals("ArrayList → text (text-plain does not take it)", 
CamelRouteStructureAction.bodyText(
+                List.of("java.util.ArrayList"), List.of("collection"), null,
+                Map.of("dataType", "text", "transformer", "text-plain", 
"takesBody", false)));
+        // no Kamelet
+        assertEquals("byte[] · json", CamelRouteStructureAction.bodyText(
+                List.of("byte[]"), List.of("payload"), List.of("json"), null));
+    }
+
     @Test
     void testOnlyVariedKeepsAStepOfMoreThanOneFormat() {
         JsonObject line = codeLine(5, "to", "to1", 1, "to[http://stock]";, 
List.of("byte[]"), List.of("payload"));
diff --git 
a/dsl/camel-jbang/camel-jbang-core/src/test/java/org/apache/camel/dsl/jbang/core/commands/ai/KameletInputTest.java
 
b/dsl/camel-jbang/camel-jbang-core/src/test/java/org/apache/camel/dsl/jbang/core/commands/ai/KameletInputTest.java
new file mode 100644
index 000000000000..e27ddd10d1f0
--- /dev/null
+++ 
b/dsl/camel-jbang/camel-jbang-core/src/test/java/org/apache/camel/dsl/jbang/core/commands/ai/KameletInputTest.java
@@ -0,0 +1,226 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.dsl.jbang.core.commands.ai;
+
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.camel.catalog.CamelCatalog;
+import org.apache.camel.catalog.DefaultCamelCatalog;
+import org.apache.camel.util.json.JsonArray;
+import org.apache.camel.util.json.JsonObject;
+import org.apache.camel.util.json.Jsoner;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.io.TempDir;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+/**
+ * The data type a Kamelet turns the body into before its route sees it, at 
the step that calls it (CAMEL-27475).
+ */
+class KameletInputTest {
+
+    private static final CamelCatalog CATALOG = new DefaultCamelCatalog();
+
+    /** As postgresql-sink: one JSON object, which a Map becomes. */
+    private static final String DB_SINK = """
+            apiVersion: camel.apache.org/v1
+            kind: Kamelet
+            metadata:
+              name: db-sink
+              labels:
+                camel.apache.org/kamelet.type: sink
+            spec:
+              definition:
+                title: DB Sink
+              dataTypes:
+                in:
+                  default: json
+                  types:
+                    json:
+                      format: application-json
+                      description: One JSON object, as JSON text in bytes.
+                      mediaType: application/json
+              template:
+                from:
+                  uri: kamelet:source
+                  steps:
+                    - to: log:db
+            """;
+
+    /** As csv-deserialize-action: the CSV text. */
+    private static final String CSV_ACTION = """
+            apiVersion: camel.apache.org/v1
+            kind: Kamelet
+            metadata:
+              name: csv-action
+              labels:
+                camel.apache.org/kamelet.type: action
+            spec:
+              definition:
+                title: CSV Action
+              dataTypes:
+                in:
+                  default: text
+                  types:
+                    text:
+                      format: text-plain
+                      mediaType: text/plain
+              template:
+                from:
+                  uri: kamelet:source
+                  steps:
+                    - unmarshal:
+                        csv: {}
+            """;
+
+    /** No default in data type: the Kamelet gets the body as it is. */
+    private static final String LOG_SINK = """
+            apiVersion: camel.apache.org/v1
+            kind: Kamelet
+            metadata:
+              name: my-log-sink
+              labels:
+                camel.apache.org/kamelet.type: sink
+            spec:
+              definition:
+                title: Log Sink
+              template:
+                from:
+                  uri: kamelet:source
+                  steps:
+                    - to: log:out
+            """;
+
+    @BeforeAll
+    static void setUp() {
+        // no Kamelet catalog: the project's own Kamelets only
+        KameletDefinitions.setTestCatalog(Map.of());
+    }
+
+    @AfterAll
+    static void tearDown() {
+        KameletDefinitions.setTestCatalog(null);
+    }
+
+    private static Path project(Path dir) throws Exception {
+        Files.writeString(dir.resolve("db-sink.kamelet.yaml"), DB_SINK);
+        Files.writeString(dir.resolve("csv-action.kamelet.yaml"), CSV_ACTION);
+        Files.writeString(dir.resolve("my-log-sink.kamelet.yaml"), LOG_SINK);
+        return dir;
+    }
+
+    @Test
+    void theNameOfTheKameletAUriCalls() {
+        
assertThat(KameletInput.kameletName("kamelet:postgresql-sink?serverName=db")).isEqualTo("postgresql-sink");
+        
assertThat(KameletInput.kameletName("kamelet://postgresql-sink")).isEqualTo("postgresql-sink");
+        
assertThat(KameletInput.kameletName("kamelet:aws-s3-sink/route1")).isEqualTo("aws-s3-sink");
+        // the ends of the route of a Kamelet, a dynamic name, and another 
component
+        assertThat(KameletInput.kameletName("kamelet:sink")).isNull();
+        assertThat(KameletInput.kameletName("kamelet:source")).isNull();
+        
assertThat(KameletInput.kameletName("kamelet:${header.target}")).isNull();
+        assertThat(KameletInput.kameletName("log:foo")).isNull();
+        assertThat(KameletInput.kameletName(null)).isNull();
+    }
+
+    @Test
+    void theDataTypeAndWhatItsTransformerTakes(@TempDir Path dir) throws 
Exception {
+        KameletInput in = KameletInput.find("kamelet:db-sink?query=x", 
project(dir), CATALOG);
+
+        assertThat(in.dataType()).isEqualTo("json");
+        assertThat(in.transformer()).isEqualTo("application-json");
+        assertThat(in.mediaType()).isEqualTo("application/json");
+        assertThat(in.description()).isEqualTo("One JSON object, as JSON text 
in bytes.");
+        // the catalog says what application-json takes: also a Map, a List 
and a POJO, which it writes as JSON
+        assertThat(in.carriers()).contains("text", "bytes", "stream", "map", 
"list", "pojo");
+        assertThat(in.takes()).isNotBlank();
+        assertThat(in.carriersInWords()).contains("a Map", "a List", "a 
POJO").endsWith(" or no body");
+
+        // a Kamelet with no default in data type gets the body as it is, and 
one that is not known says nothing
+        assertThat(KameletInput.find("kamelet:my-log-sink", dir, 
CATALOG)).isNull();
+        assertThat(KameletInput.find("kamelet:unknown-sink", dir, 
CATALOG)).isNull();
+    }
+
+    @Test
+    void whetherTheTransformerTakesTheBodies(@TempDir Path dir) throws 
Exception {
+        KameletInput json = KameletInput.find("kamelet:db-sink", project(dir), 
CATALOG);
+        KameletInput text = KameletInput.find("kamelet:csv-action", dir, 
CATALOG);
+
+        // the rows of the blog sample: a Map into a sink that takes JSON is 
fine
+        assertThat(json.takes(List.of("java.util.LinkedHashMap"), 
List.of("data"))).isTrue();
+        // a File into csv-deserialize-action is fine too: text-plain reads 
the file
+        assertThat(text.takes(List.of("java.io.File"), 
List.of("payload"))).isTrue();
+        // the List of rows is not text
+        assertThat(text.takes(List.of("java.util.ArrayList"), 
List.of("collection"))).isFalse();
+        
assertThat(json.takes(List.of("org.apache.camel.component.file.GenericFile"), 
List.of("payload"))).isFalse();
+        // a stream cache of Camel is a stream
+        
assertThat(json.takes(List.of("org.apache.camel.converter.stream.ByteArrayInputStreamCache"),
 List.of("payload")))
+                .isTrue();
+        // a class the catalog has no name for, as a payload: not known, so no 
warning
+        assertThat(json.takes(List.of("com.acme.Payload"), 
List.of("payload"))).isNull();
+        // not reached yet
+        assertThat(json.takes(List.of(), List.of())).isNull();
+    }
+
+    @Test
+    void theRouteStructureHasTheDataTypeOfEachStepThatCallsAKamelet(@TempDir 
Path dir) throws Exception {
+        JsonObject structure = (JsonObject) Jsoner.deserialize("""
+                {"routes": [{"routeId": "csv-to-db", "code": [
+                  {"type": "route", "id": "csv-to-db", "level": 0, "code": 
"route[csv-to-db]"},
+                  {"type": "from", "id": "from1", "level": 1, "code": 
"from[kamelet:file-watch-source]",
+                   "uri": "kamelet:file-watch-source"},
+                  {"type": "to", "id": "to1", "level": 2, "code": 
"to[kamelet:csv-action]", "uri": "kamelet:csv-action",
+                   "bodyTypes": ["java.io.File"], "bodyKinds": ["payload"]},
+                  {"type": "split", "id": "split1", "level": 2, "code": 
"split[${body}]"},
+                  {"type": "to", "id": "to2", "level": 3, "code": 
"to[kamelet:db-sink]", "uri": "kamelet:db-sink",
+                   "bodyTypes": ["java.util.LinkedHashMap"], "bodyKinds": 
["data"]},
+                  {"type": "kamelet", "id": "kamelet1", "level": 3, "code": 
"kamelet[csv-action]"},
+                  {"type": "to", "id": "to3", "level": 3, "code": 
"to[kamelet:my-log-sink]",
+                   "uri": "kamelet:my-log-sink"}]}]}
+                """, (JsonObject) null);
+
+        int added = KameletInput.addTo(structure, project(dir), CATALOG);
+
+        assertThat(added).isEqualTo(3);
+        List<JsonObject> code = ((JsonObject) ((JsonArray) 
structure.getCollection("routes")).get(0)).getCollection("code");
+        JsonObject csv = (JsonObject) code.get(2).get("kameletInput");
+        assertThat(csv.getString("dataType")).isEqualTo("text");
+        assertThat(csv.getBoolean("takesBody")).isTrue();
+        JsonObject db = (JsonObject) code.get(4).get("kameletInput");
+        assertThat(db.getString("dataType")).isEqualTo("json");
+        assertThat(db.getString("transformer")).isEqualTo("application-json");
+        assertThat(db.getBoolean("takesBody")).isTrue();
+        // the kamelet EIP, not reached yet: the data type, and nothing about 
the body
+        JsonObject eip = (JsonObject) code.get(5).get("kameletInput");
+        assertThat(eip.getString("dataType")).isEqualTo("text");
+        assertThat(eip.containsKey("takesBody")).isFalse();
+        // a Kamelet without a default in data type, and the from
+        assertThat(code.get(6).containsKey("kameletInput")).isFalse();
+        assertThat(code.get(1).containsKey("kameletInput")).isFalse();
+    }
+
+    @Test
+    void theArrowInWords() {
+        assertThat(KameletInput.arrowText("json", true, 
"application-json")).isEqualTo("→ json");
+        assertThat(KameletInput.arrowText("json", null, 
"application-json")).isEqualTo("→ json");
+        assertThat(KameletInput.arrowText("text", false, 
"text-plain")).isEqualTo("→ text (text-plain does not take it)");
+    }
+}
diff --git 
a/dsl/camel-jbang/camel-jbang-mcp/src/main/java/org/apache/camel/dsl/jbang/core/commands/mcp/RuntimeTools.java
 
b/dsl/camel-jbang/camel-jbang-mcp/src/main/java/org/apache/camel/dsl/jbang/core/commands/mcp/RuntimeTools.java
index 394df3303516..5665fdf6cd95 100644
--- 
a/dsl/camel-jbang/camel-jbang-mcp/src/main/java/org/apache/camel/dsl/jbang/core/commands/mcp/RuntimeTools.java
+++ 
b/dsl/camel-jbang/camel-jbang-mcp/src/main/java/org/apache/camel/dsl/jbang/core/commands/mcp/RuntimeTools.java
@@ -272,7 +272,10 @@ public class RuntimeTools {
                         + " bodyKinds: null, payload, data or collection. More 
than one kind needs attention: a step that"
                         + " writes fails for data, one that reads fields fails 
for a payload. bodyFormats: the format of"
                         + " the payload from its Content-Type (json, xml, csv, 
yaml, text, binary or the media type), to"
-                        + " compare with the format the catalog says a step 
takes. The routes tool counts them"
+                        + " compare with the format the catalog says a step 
takes. kameletInput: the data type a"
+                        + " Kamelet the step calls turns the body into, such 
as json for postgresql-sink, which writes a"
+                        + " Map as JSON; takesBody false when its transformer 
does not take the body. The routes tool"
+                        + " counts them"
                         + " per route (mixedBodyKinds). The checksum of each 
route says which version of the route the"
                         + " facts of its lines are of.")
     public JsonObject camel_runtime_route_structure(
diff --git 
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/DataRefreshService.java
 
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/DataRefreshService.java
index 0e0c3e867cc6..f8b8a34d1270 100644
--- 
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/DataRefreshService.java
+++ 
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/DataRefreshService.java
@@ -336,6 +336,8 @@ class DataRefreshService {
                     info.statusWrittenAt = writtenAt(pid);
                 }
                 if (info != null && ctx != null) {
+                    // the data type each Kamelet a step calls turns the body 
into (CAMEL-27475)
+                    KameletInputs.attach(info);
                     ctx.chaosMarks.record(info);
                     ctx.timeline.record(info, info.statusWrittenAt);
                     mergeTimelineFile(pid);
diff --git 
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/DiagramDetailSupport.java
 
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/DiagramDetailSupport.java
index 831e806dc0cd..609b20974ba3 100644
--- 
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/DiagramDetailSupport.java
+++ 
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/DiagramDetailSupport.java
@@ -583,6 +583,7 @@ final class DiagramDetailSupport {
      * and one reached with more than one format is marked too. The diagram 
shows them cut, and with y only.
      */
     static void addBodyTypes(List<Line> lines, 
RouteDiagramLayoutEngine.NodeInfo info, int width) {
+        addKameletInput(lines, info, width);
         if (info.bodyTypes.isEmpty()) {
             return;
         }
@@ -620,6 +621,36 @@ final class DiagramDetailSupport {
         }
     }
 
+    /**
+     * What the Kamelet the step calls takes (CAMEL-27475): its data type, 
which Camel turns the body into before the
+     * Kamelet sees it, so a Map that reaches a Kamelet that takes json is 
fine; a warning when its transformer does not
+     * take the body.
+     */
+    private static void addKameletInput(List<Line> lines, 
RouteDiagramLayoutEngine.NodeInfo info, int width) {
+        var in = info.kameletInput;
+        if (in == null) {
+            return;
+        }
+        lines.add(Line.from(Span.raw("")));
+        lines.add(Line.from(Span.styled(" Kamelet takes:", Theme.muted()), 
Span.raw(" " + in.dataType())));
+        String text = (in.description() != null ? in.description() + " " : "")
+                      + "Camel turns the body into it" + (in.transformer() != 
null ? " (" + in.transformer() + ")" : "")
+                      + " before the Kamelet sees it.";
+        for (String line : wrapWords(text, Math.max(10, width - 2))) {
+            lines.add(Line.from(Span.styled("   " + line, Theme.muted())));
+        }
+        if (Boolean.FALSE.equals(in.takesBody())) {
+            List<String> warning = wrapWords(
+                    (in.transformer() != null ? in.transformer() : 
in.dataType()) + " does not take this body: convert"
+                                             + " it first",
+                    Math.max(10, width - 2));
+            for (int i = 0; i < warning.size(); i++) {
+                lines.add(Line.from(Span.styled((i == 0 ? " " + BodyTypes.MARK 
+ " " : "   ") + warning.get(i),
+                        Theme.warning())));
+            }
+        }
+    }
+
     /** The statistics of a step: its counts, its rate, its times, and how 
long since its last message. */
     private void addStepStatistics(List<Line> lines, 
RouteDiagramLayoutEngine.StatInfo stat, int width) {
         lines.add(Line.from(Span.raw("")));
diff --git 
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/DiagramTopology.java
 
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/DiagramTopology.java
index ef300a3b2a70..feebcffebe80 100644
--- 
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/DiagramTopology.java
+++ 
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/DiagramTopology.java
@@ -302,7 +302,7 @@ final class DiagramTopology {
             if (p.id != null && p.statistics != null) {
                 steps.put(p.id, p.statistics);
             }
-            if (p.id != null && !p.bodyTypes.isEmpty()) {
+            if (p.id != null && (!p.bodyTypes.isEmpty() || p.kameletInput != 
null)) {
                 bodies.put(p.id, p);
             }
         }
@@ -320,7 +320,10 @@ final class DiagramTopology {
                     line.put("statistics", statistics instanceof JsonObject jo 
? jo : new JsonObject(statistics));
                 }
                 ProcessorInfo body = index > 1 ? 
bodies.get(line.getString("id")) : null;
-                if (body != null) {
+                if (body != null && body.kameletInput != null) {
+                    line.put("kameletInput", KameletInputs.toJson(body));
+                }
+                if (body != null && !body.bodyTypes.isEmpty()) {
                     line.put("bodyTypes", new JsonArray(body.bodyTypes));
                     line.put("bodyKinds", new JsonArray(body.bodyKinds));
                     if (!body.bodyFormats.isEmpty()) {
diff --git 
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/IntegrationInfo.java
 
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/IntegrationInfo.java
index a559de4b30ce..f795ca0991cd 100644
--- 
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/IntegrationInfo.java
+++ 
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/IntegrationInfo.java
@@ -29,6 +29,11 @@ class IntegrationInfo {
     String pid;
     String name;
     String camelVersion;
+    /**
+     * The version of the Kamelet catalog the integration uses (camel run 
--kamelets-version), from its
+     * camel.jbang.kameletsVersion property; null when it does not say.
+     */
+    String kameletsVersion;
     String platform;
     String platformVersion;
     String javaVersion;
diff --git 
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/KameletInputs.java
 
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/KameletInputs.java
new file mode 100644
index 000000000000..52bdf66b4279
--- /dev/null
+++ 
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/KameletInputs.java
@@ -0,0 +1,204 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.dsl.jbang.core.commands.tui;
+
+import java.nio.file.Path;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+import dev.tamboui.style.Style;
+import org.apache.camel.catalog.CamelCatalog;
+import org.apache.camel.catalog.DefaultCamelCatalog;
+import org.apache.camel.dsl.jbang.core.commands.ai.KameletDefinitions;
+import org.apache.camel.dsl.jbang.core.commands.ai.KameletInput;
+import org.apache.camel.util.json.JsonObject;
+
+/**
+ * The data type each Kamelet a step calls turns the body into (CAMEL-27475), 
for the views: postgresql-sink takes json,
+ * and its transformer writes the Map of a row as JSON, so a {@code 
LinkedHashMap} at the step is fine.
+ * <p>
+ * The Kamelets are looked up in the project's own Kamelet files and else the 
Kamelet catalog, which may have to be
+ * loaded first: that happens on a thread of its own, and a view shows the 
data type from the next refresh on. A Kamelet
+ * is looked up again after a while, so a Kamelet file that is edited is 
picked up.
+ */
+final class KameletInputs {
+
+    /** How long a Kamelet that was looked up is kept before it is looked up 
again. */
+    private static final long KEEP_MILLIS = 30_000;
+
+    private static final Map<String, Entry> CACHE = new ConcurrentHashMap<>();
+    private static final ExecutorService LOADER = 
Executors.newSingleThreadExecutor(r -> {
+        Thread t = new Thread(r, "CamelTuiKameletInputs");
+        t.setDaemon(true);
+        return t;
+    });
+    private static volatile CamelCatalog catalog;
+
+    /** A Kamelet that was looked up (input null when it has no default in 
data type, or is not known). */
+    private record Entry(KameletInput input, long time, boolean loading) {
+    }
+
+    private KameletInputs() {
+    }
+
+    /**
+     * Sets, on each processor of the integration that calls a Kamelet, the 
data type the Kamelet turns the body into,
+     * as far as it has been looked up.
+     */
+    static void attach(IntegrationInfo info) {
+        Path directory = null;
+        boolean resolved = false;
+        for (RouteInfo route : info.routes) {
+            for (ProcessorInfo p : route.processors) {
+                String name = KameletInput.kameletName(p.uri);
+                if (name == null) {
+                    continue;
+                }
+                if (!resolved) {
+                    directory = directory(info);
+                    resolved = true;
+                }
+                p.kameletInput = get(name, directory, info.kameletsVersion);
+            }
+        }
+    }
+
+    /**
+     * The data type the Kamelet turns the body into, or null while it is 
looked up, or when it has no default in data
+     * type.
+     */
+    static KameletInput get(String name, Path directory, String 
kameletsVersion) {
+        String key = directory + "|" + kameletsVersion + "|" + name;
+        long now = MonotonicClock.millis();
+        Entry entry = CACHE.get(key);
+        if (entry == null || !entry.loading() && now - entry.time() > 
KEEP_MILLIS) {
+            Entry loading = new Entry(entry != null ? entry.input() : null, 
now, true);
+            boolean mine = entry == null ? CACHE.putIfAbsent(key, loading) == 
null : CACHE.replace(key, entry, loading);
+            if (mine) {
+                LOADER.execute(() -> CACHE.put(key,
+                        new Entry(load(name, directory, kameletsVersion), 
MonotonicClock.millis(), false)));
+            }
+            return loading.input();
+        }
+        return entry.input();
+    }
+
+    /**
+     * Looks the Kamelet up now: the project's own Kamelets, else the catalog 
of the Kamelets the integration runs
+     * (camel run --kamelets-version), which may not be the one of the Camel 
CLI.
+     */
+    static KameletInput load(String name, Path directory, String 
kameletsVersion) {
+        try {
+            KameletDefinitions.Definition def = KameletDefinitions.find(name, 
directory, kameletsVersion);
+            return def != null ? KameletInput.of(def, catalog()) : null;
+        } catch (Exception e) {
+            // a Kamelet that cannot be read shows no data type
+            return null;
+        }
+    }
+
+    private static CamelCatalog catalog() {
+        CamelCatalog answer = catalog;
+        if (answer == null) {
+            answer = new DefaultCamelCatalog(true);
+            catalog = answer;
+        }
+        return answer;
+    }
+
+    private static Path directory(IntegrationInfo info) {
+        try {
+            return info.phantom && info.sourceDir != null
+                    ? Path.of(info.sourceDir) : 
FilesBrowser.resolveSourceDirectory(info);
+        } catch (Exception e) {
+            return null;
+        }
+    }
+
+    /** Package-private for tests: forgets what was looked up. */
+    static void clearForTesting() {
+        CACHE.clear();
+    }
+
+    /**
+     * The data type after the body types: " → json", with why it needs 
attention when the transformer does not take the
+     * body; empty without one.
+     */
+    static String arrow(KameletInput in, Boolean takes) {
+        return in == null ? "" : " " + KameletInput.arrowText(in.dataType(), 
takes, in.transformer());
+    }
+
+    /**
+     * The body column of a step in a table: its body types and the data type 
of the Kamelet it calls, "⚠ String |
+     * LinkedHashMap → json", or "→ json" before a message has reached it.
+     */
+    static String shortLabel(ProcessorInfo p) {
+        String types = BodyTypes.shortLabel(p.bodyTypes, p.bodyKinds, 
p.bodyFormats);
+        if (p.kameletInput == null) {
+            return types;
+        }
+        Boolean takes = p.kameletInput.takes(p.bodyTypes, p.bodyKinds);
+        String arrow = arrow(p.kameletInput, takes).strip();
+        if (Boolean.FALSE.equals(takes) && !BodyTypes.marked(p.bodyKinds, 
p.bodyFormats)) {
+            types = BodyTypes.MARK + " " + types;
+        }
+        return types.isEmpty() ? arrow : types + " " + arrow;
+    }
+
+    /** The style of the body column: a warning when it needs attention, muted 
otherwise. */
+    static Style style(ProcessorInfo p) {
+        boolean notTaken = p.kameletInput != null
+                && Boolean.FALSE.equals(p.kameletInput.takes(p.bodyTypes, 
p.bodyKinds));
+        return notTaken ? Theme.warning() : BodyTypes.style(p.bodyKinds, 
p.bodyFormats);
+    }
+
+    /** The kameletInput of a line of the route structure, for the diagram 
(RouteDiagramHelper reads it). */
+    static JsonObject toJson(ProcessorInfo p) {
+        return p.kameletInput != null ? 
p.kameletInput.toJson(p.kameletInput.takes(p.bodyTypes, p.bodyKinds)) : null;
+    }
+
+    /**
+     * The quick documentation of a step that calls a Kamelet: what it takes 
and why a Map is fine, in the words a Camel
+     * developer knows; the Kamelets come from event-driven and serverless 
integration, where the data is JSON.
+     */
+    static String doc(KameletInput in, List<String> types, List<String> kinds) 
{
+        StringBuilder sb = new StringBuilder();
+        sb.append("The Kamelet ").append(in.kamelet()).append(" takes 
").append(in.dataType());
+        if (in.description() != null) {
+            sb.append(": ").append(in.description());
+            if (!in.description().endsWith(".")) {
+                sb.append('.');
+            }
+        } else {
+            sb.append('.');
+        }
+        String words = in.carriersInWords();
+        if (words != null) {
+            sb.append(" Camel turns the body into it before the Kamelet sees 
it, with the data type transformer ")
+                    .append(in.transformer()).append(", which takes 
").append(words).append('.');
+        }
+        Boolean takes = in.takes(types, kinds);
+        if (Boolean.FALSE.equals(takes)) {
+            sb.append(' ').append(BodyTypes.MARK).append(" It does not take 
").append(BodyTypes.names(types))
+                    .append(": convert the body first.");
+        }
+        return sb.toString();
+    }
+}
diff --git 
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/LiveRunLines.java
 
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/LiveRunLines.java
index e32e726b0732..62e6b4153d9c 100644
--- 
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/LiveRunLines.java
+++ 
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/LiveRunLines.java
@@ -22,6 +22,8 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
+import org.apache.camel.dsl.jbang.core.commands.ai.KameletInput;
+
 /**
  * The live run data of a source file: what the processors of a running 
integration on each line of it did, read from
  * the routes and processors of the status (their source location, file:line), 
for the Source tab to show at the end of
@@ -60,7 +62,7 @@ final class LiveRunLines {
                     ? new SourceLiveColumn.LiveLine(s[0], s[1], s[0] > 0 ? 
s[2] / s[0] : 0)
                     : new SourceLiveColumn.LiveLine(
                             s[0], s[1], s[0] > 0 ? s[2] / s[0] : 0, 
List.copyOf(t.types), List.copyOf(t.kinds),
-                            List.copyOf(t.formats), t.mixed));
+                            List.copyOf(t.formats), t.kameletInput, t.mixed));
         });
         return answer;
     }
@@ -73,6 +75,8 @@ final class LiveRunLines {
         final Set<String> types = new LinkedHashSet<>();
         final Set<String> kinds = new LinkedHashSet<>();
         final Set<String> formats = new LinkedHashSet<>();
+        // the data type of the Kamelet a step on the line calls (CAMEL-27475)
+        KameletInput kameletInput;
         boolean mixed;
     }
 
@@ -82,7 +86,7 @@ final class LiveRunLines {
      * one kind or payloads of more than one format (CAMEL-27468), not when 
two of them each had their own.
      */
     private static void addBodyTypes(Map<Integer, LineTypes> types, String 
name, ProcessorInfo p) {
-        if (p.bodyTypes == null || p.bodyTypes.isEmpty()) {
+        if ((p.bodyTypes == null || p.bodyTypes.isEmpty()) && p.kameletInput 
== null) {
             return;
         }
         int line = lineOf(p.source, name);
@@ -98,6 +102,11 @@ final class LiveRunLines {
             t.formats.addAll(p.bodyFormats);
         }
         t.mixed |= BodyTypes.marked(p.bodyKinds, p.bodyFormats);
+        if (p.kameletInput != null) {
+            t.kameletInput = p.kameletInput;
+            // a body the transformer of the Kamelet does not take needs 
attention
+            t.mixed |= Boolean.FALSE.equals(p.kameletInput.takes(p.bodyTypes, 
p.bodyKinds));
+        }
     }
 
     /** Adds what a processor did to its line: totals and failures summed, the 
mean time weighted by the exchanges. */
diff --git 
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/ProcessorInfo.java
 
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/ProcessorInfo.java
index cb6c642f5a56..e6324d6a7564 100644
--- 
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/ProcessorInfo.java
+++ 
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/ProcessorInfo.java
@@ -19,6 +19,8 @@ package org.apache.camel.dsl.jbang.core.commands.tui;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.camel.dsl.jbang.core.commands.ai.KameletInput;
+
 class ProcessorInfo {
     String id;
     /** The prefix of the ids of the steps of a route template or kamelet 
(only when it has one). */
@@ -55,4 +57,9 @@ class ProcessorInfo {
     List<String> bodyKinds = List.of();
     /** The formats of the payloads, from their Content-Type (CAMEL-27468): 
json, xml, csv, yaml, text, binary. */
     List<String> bodyFormats = List.of();
+    /**
+     * The data type the Kamelet the step calls turns the body into 
(CAMEL-27475), such as json for postgresql-sink;
+     * null when the step calls no Kamelet, it has no default in data type, or 
it is still looked up (KameletInputs).
+     */
+    KameletInput kameletInput;
 }
diff --git 
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/RoutesTab.java
 
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/RoutesTab.java
index 3c643fd09507..45956c738978 100644
--- 
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/RoutesTab.java
+++ 
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/RoutesTab.java
@@ -1061,13 +1061,12 @@ class RoutesTab extends AbstractDiagramTab {
                 || route.processors.stream().anyMatch(p -> p.p50Time >= 0);
         // a column only when a step has body types, as wide as the longest up 
to a limit: the info panel of the
         // diagram has them all; a space before them sets them apart from the 
inflight count
-        boolean bodyTypes = route.processors.stream().anyMatch(p -> 
!p.bodyTypes.isEmpty());
+        boolean bodyTypes = route.processors.stream().anyMatch(p -> 
!p.bodyTypes.isEmpty() || p.kameletInput != null);
         int bodyColWidth = 0;
         if (bodyTypes) {
             bodyColWidth = CharWidth.of("BODY TYPES");
             for (ProcessorInfo proc : route.processors) {
-                bodyColWidth = Math.max(bodyColWidth, 
CharWidth.of(BodyTypes.shortLabel(proc.bodyTypes, proc.bodyKinds,
-                        proc.bodyFormats)));
+                bodyColWidth = Math.max(bodyColWidth, 
CharWidth.of(KameletInputs.shortLabel(proc)));
             }
             bodyColWidth = Math.min(bodyColWidth, MAX_BODY_TYPES_WIDTH) + 1;
         }
@@ -1158,9 +1157,8 @@ class RoutesTab extends AbstractDiagramTab {
             cells.add(rightCell(String.valueOf(proc.inflight), 8));
             if (bodyTypes) {
                 cells.add(Cell.from(Span.styled(
-                        " " + TuiHelper.truncate(
-                                BodyTypes.shortLabel(proc.bodyTypes, 
proc.bodyKinds, proc.bodyFormats), bodyColWidth - 1),
-                        BodyTypes.style(proc.bodyKinds, proc.bodyFormats))));
+                        " " + 
TuiHelper.truncate(KameletInputs.shortLabel(proc), bodyColWidth - 1),
+                        KameletInputs.style(proc))));
             }
             cells.add(rightCell(procTimingCol, 20));
             cells.add(Cell.from(buildPercentileBarLine(proc.p50Time, 
proc.p95Time, proc.p99Time, 10)));
diff --git 
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/SourceLiveColumn.java
 
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/SourceLiveColumn.java
index c5e710ad14a0..8be1ccc1fc2a 100644
--- 
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/SourceLiveColumn.java
+++ 
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/SourceLiveColumn.java
@@ -26,6 +26,7 @@ import java.util.function.Supplier;
 import dev.tamboui.style.Style;
 import dev.tamboui.text.CharWidth;
 import dev.tamboui.text.Span;
+import org.apache.camel.dsl.jbang.core.commands.ai.KameletInput;
 
 /**
  * The live run data of the running integration in the source view ({@link 
SourceViewer}), a column at the end of the
@@ -50,15 +51,25 @@ class SourceLiveColumn {
      * one of them was reached with bodies of more than one kind or payloads 
of more than one format.
      */
     record LiveLine(long total, long failed, long meanMillis, List<String> 
bodyTypes, List<String> bodyKinds,
-            List<String> bodyFormats, boolean mixed) {
+            List<String> bodyFormats, KameletInput kameletInput, boolean 
mixed) {
 
         LiveLine(long total, long failed, long meanMillis) {
-            this(total, failed, meanMillis, List.of(), List.of(), List.of(), 
false);
+            this(total, failed, meanMillis, List.of(), List.of(), List.of(), 
null, false);
         }
 
         LiveLine(long total, long failed, long meanMillis, List<String> 
bodyTypes, List<String> bodyKinds,
                  boolean mixed) {
-            this(total, failed, meanMillis, bodyTypes, bodyKinds, List.of(), 
mixed);
+            this(total, failed, meanMillis, bodyTypes, bodyKinds, List.of(), 
null, mixed);
+        }
+
+        /** Whether the line has body types, or calls a Kamelet whose data 
type is known: what the end of it shows. */
+        boolean hasBody() {
+            return !bodyTypes.isEmpty() || kameletInput != null;
+        }
+
+        /** Whether the transformer of the Kamelet the line calls takes its 
bodies; null when not known. */
+        Boolean takes() {
+            return kameletInput != null ? kameletInput.takes(bodyTypes, 
bodyKinds) : null;
         }
     }
 
@@ -213,7 +224,7 @@ class SourceLiveColumn {
      */
     void addBodyTypes(List<Span> spans, int lineIndex, boolean plain, Style 
selBg, int rightEdge) {
         LiveLine live = plain || !current() ? null : 
liveLines().get(lineIndex);
-        if (live == null || live.bodyTypes().isEmpty()) {
+        if (live == null || !live.hasBody()) {
             return;
         }
         int width = 0;
@@ -221,8 +232,17 @@ class SourceLiveColumn {
             width += CharWidth.of(span.content());
         }
         int pad = Math.max(2, bodyTypesAlign - width);
-        String text = BodyTypes.fit(live.bodyTypes(), live.mixed() ? 
live.bodyKinds() : List.of(), live.bodyFormats(),
-                live.mixed(), rightEdge - width - pad);
+        // the data type of the Kamelet the line calls goes after the types 
(CAMEL-27475): LinkedHashMap → json
+        String arrow = KameletInputs.arrow(live.kameletInput(), live.takes());
+        String text = live.bodyTypes().isEmpty()
+                ? arrow.strip()
+                : BodyTypes.fit(live.bodyTypes(), live.mixed() ? 
live.bodyKinds() : List.of(), live.bodyFormats(),
+                        live.mixed(), rightEdge - width - pad - 
CharWidth.of(arrow))
+                  + arrow;
+        if (CharWidth.of(text) > rightEdge - width - pad) {
+            text = CharWidth.truncateWithEllipsis(text, Math.max(0, rightEdge 
- width - pad), "…",
+                    CharWidth.TruncatePosition.END);
+        }
         if (text.isEmpty()) {
             return;
         }
@@ -260,6 +280,34 @@ class SourceLiveColumn {
         return live.bodyKinds().size() == 1 ? "Body types (" + 
live.bodyKinds().get(0) + ")" : "Body types";
     }
 
+    /** The quick documentation of the live run data of a line: its body 
types, and the Kamelet it calls. */
+    List<SourceViewer.DocEntry> docs(int row) {
+        List<SourceViewer.DocEntry> answer = new ArrayList<>(2);
+        SourceViewer.DocEntry types = bodyTypesDoc(row);
+        if (types != null) {
+            answer.add(types);
+        }
+        SourceViewer.DocEntry kamelet = kameletDoc(row);
+        if (kamelet != null) {
+            answer.add(kamelet);
+        }
+        return answer;
+    }
+
+    /**
+     * What the Kamelet the line calls takes, for the quick documentation 
(CAMEL-27475): its data type, why a Map or a
+     * POJO is fine, and whether it takes the bodies the line was reached 
with; null when the line calls no Kamelet
+     * whose data type is known.
+     */
+    SourceViewer.DocEntry kameletDoc(int row) {
+        LiveLine live = current() ? liveLines().get(row) : null;
+        if (live == null || live.kameletInput() == null) {
+            return null;
+        }
+        return SourceViewer.DocEntry.withTitle("Kamelet data type",
+                KameletInputs.doc(live.kameletInput(), live.bodyTypes(), 
live.bodyKinds()));
+    }
+
     /** The live run data of the loaded file, read again at most once a second 
(the status is polled about as often). */
     private Map<Integer, LiveLine> liveLines() {
         String loadedFilePath = loadedFile.get();
@@ -328,7 +376,7 @@ class SourceLiveColumn {
         int longest = 0;
         for (Map.Entry<Integer, LiveLine> e : liveLines.entrySet()) {
             int i = e.getKey();
-            if (!e.getValue().bodyTypes().isEmpty() && shown != null && i >= 0 
&& i < shown.size()) {
+            if (e.getValue().hasBody() && shown != null && i >= 0 && i < 
shown.size()) {
                 longest = Math.max(longest, 
Math.min(CharWidth.of(shown.get(i)), MAX_BODY_TYPES_ALIGN));
             }
         }
diff --git 
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/SourceTab.java
 
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/SourceTab.java
index a506de36dc08..7be7a2bf7af8 100644
--- 
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/SourceTab.java
+++ 
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/SourceTab.java
@@ -1632,11 +1632,9 @@ class SourceTab extends AbstractTab {
                 return base;
             }
             List<SourceViewer.DocEntry> extra = new ArrayList<>();
-            // the body types the steps of the line have been reached with, 
while it runs as shown (CAMEL-25897)
-            SourceViewer.DocEntry bodyTypes = 
sourceViewer.liveColumn().bodyTypesDoc(row);
-            if (bodyTypes != null) {
-                extra.add(bodyTypes);
-            }
+            // the body types the steps of the line have been reached with, 
while it runs as shown (CAMEL-25897), and
+            // what the Kamelet the line calls takes (CAMEL-27475)
+            extra.addAll(sourceViewer.liveColumn().docs(row));
             extra.addAll(assist.placeholderDocs(lines.get(row)));
             ProjectBeans.Location bean = projectBeans().refOn(lines.get(row));
             if (bean != null) {
diff --git 
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/StatusParser.java
 
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/StatusParser.java
index 28458e23c0c5..eb515cba45c8 100644
--- 
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/StatusParser.java
+++ 
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/StatusParser.java
@@ -875,6 +875,10 @@ final class StatusParser {
                 for (Object p : propArr) {
                     JsonObject pj = (JsonObject) p;
                     String key = pj.getString("key");
+                    if ("camel.jbang.kameletsVersion".equals(key)) {
+                        // the Kamelets the integration runs, for what they 
take (CAMEL-27475)
+                        info.kameletsVersion = objToString(pj.get("value"));
+                    }
                     if (key != null && !key.startsWith("camel.jbang.")) {
                         ConfigurationTab.ConfigProperty cp = new 
ConfigurationTab.ConfigProperty();
                         cp.key = key;
diff --git 
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/diagram/RouteDiagramWidget.java
 
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/diagram/RouteDiagramWidget.java
index fffc27af4b21..77fe42648755 100644
--- 
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/diagram/RouteDiagramWidget.java
+++ 
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/diagram/RouteDiagramWidget.java
@@ -38,6 +38,7 @@ import 
org.apache.camel.diagram.RouteDiagramLayoutEngine.LayoutRoute;
 import org.apache.camel.diagram.RouteDiagramLayoutEngine.StatInfo;
 import org.apache.camel.diagram.RouteDiagramLayoutEngine.TreeNode;
 import org.apache.camel.diagram.RouteErrorFrame;
+import org.apache.camel.dsl.jbang.core.commands.ai.KameletInput;
 import org.apache.camel.dsl.jbang.core.commands.tui.BodyTypes;
 import org.apache.camel.dsl.jbang.core.commands.tui.BusinessEndpointLabels;
 import org.apache.camel.dsl.jbang.core.commands.tui.Theme;
@@ -350,7 +351,7 @@ public class RouteDiagramWidget implements Widget {
     }
 
     private void addArrowEnd(LayoutNode to, int fromCx, int fromRow, int toCx, 
int toTop, int countWidth) {
-        if (bodyTypes && to.treeNode != null && 
!to.treeNode.info.bodyTypes.isEmpty()) {
+        if (bodyTypes && to.treeNode != null && hasBody(to.treeNode.info)) {
             arrowEnds.add(new ArrowEnd(to, fromCx, fromRow, toCx, toTop, 
countWidth));
         }
     }
@@ -368,12 +369,33 @@ public class RouteDiagramWidget implements Widget {
             col += end.countWidth() > 0 ? end.countWidth() + 2 : 0;
         }
         var info = end.to().treeNode.info;
-        String text = BodyTypes.fit(info.bodyTypes, info.bodyKinds, 
info.bodyFormats, room(row, col));
+        // the data type of the Kamelet the step calls goes after the types 
(CAMEL-27475): LinkedHashMap → json
+        String arrow = kameletArrow(info);
+        int room = room(row, col);
+        String text = info.bodyTypes.isEmpty()
+                ? arrow.strip()
+                : BodyTypes.fit(info.bodyTypes, info.bodyKinds, 
info.bodyFormats, room - CharWidth.of(arrow)) + arrow;
+        if (CharWidth.of(text) > room) {
+            text = CharWidth.truncateWithEllipsis(text, Math.max(0, room), 
"…", CharWidth.TruncatePosition.END);
+        }
         if (!text.isEmpty()) {
-            writeText(buffer, area, row, col, text, 
BodyTypes.style(info.bodyKinds, info.bodyFormats));
+            boolean notTaken = info.kameletInput != null && 
Boolean.FALSE.equals(info.kameletInput.takesBody());
+            writeText(buffer, area, row, col, text,
+                    notTaken ? Theme.warning() : 
BodyTypes.style(info.bodyKinds, info.bodyFormats));
         }
     }
 
+    /** Whether a step has body types, or calls a Kamelet whose data type is 
known. */
+    private static boolean hasBody(RouteDiagramLayoutEngine.NodeInfo info) {
+        return !info.bodyTypes.isEmpty() || info.kameletInput != null;
+    }
+
+    /** The data type of the Kamelet a step calls, after its types: " → json"; 
empty when it calls none. */
+    private static String kameletArrow(RouteDiagramLayoutEngine.NodeInfo info) 
{
+        var in = info.kameletInput;
+        return in == null ? "" : " " + KameletInput.arrowText(in.dataType(), 
in.takesBody(), in.transformer());
+    }
+
     /**
      * The columns free on the row from the column, two left blank before a 
box, an arrow or a marker so the types do
      * not read as part of it.
@@ -479,9 +501,9 @@ public class RouteDiagramWidget implements Widget {
         if (bodyTypes) {
             // the body types beside the arrows can be scrolled to: as wide as 
they are before something cuts them
             for (LayoutNode ln : layoutRoute.nodes) {
-                if (!ln.tableRow && ln.treeNode != null && 
!ln.treeNode.info.bodyTypes.isEmpty()) {
+                if (!ln.tableRow && ln.treeNode != null && 
hasBody(ln.treeNode.info)) {
                     int label = 
CharWidth.of(BodyTypes.label(ln.treeNode.info.bodyTypes, 
ln.treeNode.info.bodyKinds,
-                            ln.treeNode.info.bodyFormats));
+                            ln.treeNode.info.bodyFormats) + 
kameletArrow(ln.treeNode.info));
                     cols = Math.max(cols, centerCol(ln) + 2 + COUNT_WIDTH + 
Math.min(MAX_BODY_TYPES_WIDTH, label) + 2);
                 }
             }
@@ -569,7 +591,9 @@ public class RouteDiagramWidget implements Widget {
         }
 
         if (bodyKindMarks && node.treeNode != null
-                && BodyTypes.marked(node.treeNode.info.bodyKinds, 
node.treeNode.info.bodyFormats)) {
+                && (BodyTypes.marked(node.treeNode.info.bodyKinds, 
node.treeNode.info.bodyFormats)
+                        || node.treeNode.info.kameletInput != null
+                                && 
Boolean.FALSE.equals(node.treeNode.info.kameletInput.takesBody()))) {
             // bodies of more than one kind, or payloads of more than one 
format, reach the step: it needs attention
             writeText(buffer, area, row, col + boxWidth - 3, BodyTypes.MARK, 
Theme.warning());
         }
diff --git 
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/resources/tui/help/diagram.md 
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/resources/tui/help/diagram.md
index 8f288fd271b2..8cf092467840 100644
--- 
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/resources/tui/help/diagram.md
+++ 
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/resources/tui/help/diagram.md
@@ -196,7 +196,9 @@ types are cut to the room there is: the first ones and how 
many more
 lists them all with their kind, and the formats of the payloads from their
 `Content-Type` (`byte[] · json`: json, xml, csv, yaml, text, binary, or the
 media type as it is); a step reached with more than one format is marked as
-one of more than one kind is. In the topology the Info panel of a
+one of more than one kind is. A step that calls a Kamelet has the data type
+the Kamelet takes after its types (`LinkedHashMap → json`), and its Info
+panel says what the Kamelet takes. In the topology the Info panel of a
 route says how many of its steps were reached with more than one type
 (`⚠ 1 mixed · 2 varied`).
 
diff --git 
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/resources/tui/help/routes.md 
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/resources/tui/help/routes.md
index 00e00b8443d7..d76899d47711 100644
--- 
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/resources/tui/help/routes.md
+++ 
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/resources/tui/help/routes.md
@@ -27,7 +27,7 @@ Below the routes are the steps of the selected route, with 
the same numbers:
 - **PROCESSOR** — What the step does, as the route diagram shows it: where it 
sends to (`log:outbox`), its expression (`simple{${body}}`) or its data format 
(`jackson`). An id the route gives a step (`id: audit`) is shown first; the ids 
Camel generates (`to1`, `setBody2`) are left out, as they only repeat the type
 - **REDEL** — The redeliveries of the error handler at this step: an exchange 
that failed here and was tried again, whether the next attempt succeeded or 
not. The route row counts the exchanges that completed after a redelivery. 
Shown when the error handler redelivered an exchange of the route, or handled 
one
 - **HAND** — The failures the error handler handled, such as an exchange moved 
to a dead letter channel: the route counts them as done, not failed, so FAIL 
stays 0
-- **BODY TYPES** — The body types the step has been reached with, across the 
messages (with the message history on), and the format of the payload from its 
Content-Type, such as `byte[] · json`
+- **BODY TYPES** — The body types the step has been reached with, across the 
messages (with the message history on), and the format of the payload from its 
Content-Type, such as `byte[] · json`; for a step that calls a Kamelet, the 
data type the Kamelet takes, such as `LinkedHashMap → json`
 
 ## Percentile Latency (P50/P95/P99)
 
diff --git 
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/resources/tui/help/source.md 
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/resources/tui/help/source.md
index 66e3a1a262f4..7ba3dfc60dd9 100644
--- 
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/resources/tui/help/source.md
+++ 
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/resources/tui/help/source.md
@@ -64,6 +64,14 @@ of the catalog: `byte[] · json` (json, xml, csv, yaml, text, 
binary, or the
 media type as it is). A step reached with more than one format
 (`⚠ String · xml | csv`) is marked as one of more than one kind is.
 
+A step that calls a Kamelet also says the data type the Kamelet takes, which
+Camel turns the body into before the Kamelet sees it: `LinkedHashMap → json`
+for `postgresql-sink`, or `→ json` before a message has reached it. A Map is
+fine there: the data type transformer writes it as JSON (Kamelets come from
+event-driven integration, where the data is JSON). A body the transformer
+does not take is marked: `⚠ ArrayList → text (text-plain does not take it)`.
+The quick documentation of the line says what the Kamelet takes.
+
 The live run data and the body types are of the version of the file the
 integration runs: while it is not running as saved (see below), the numbers
 are dimmed and the body types are left out, as the lines may be others.
diff --git 
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/test/java/org/apache/camel/dsl/jbang/core/commands/tui/KameletInputsTest.java
 
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/test/java/org/apache/camel/dsl/jbang/core/commands/tui/KameletInputsTest.java
new file mode 100644
index 000000000000..88e3269d39e1
--- /dev/null
+++ 
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/test/java/org/apache/camel/dsl/jbang/core/commands/tui/KameletInputsTest.java
@@ -0,0 +1,254 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.dsl.jbang.core.commands.tui;
+
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+
+import dev.tamboui.buffer.Buffer;
+import dev.tamboui.layout.Rect;
+import dev.tamboui.terminal.Frame;
+import dev.tamboui.text.Line;
+import dev.tamboui.text.Span;
+import org.apache.camel.diagram.RouteDiagramHelper;
+import org.apache.camel.diagram.RouteDiagramLayoutEngine;
+import org.apache.camel.dsl.jbang.core.commands.ai.KameletInput;
+import org.apache.camel.dsl.jbang.core.commands.tui.SourceLiveColumn.LiveLine;
+import org.apache.camel.util.json.JsonObject;
+import org.apache.camel.util.json.Jsoner;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.io.TempDir;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.awaitility.Awaitility.await;
+
+/**
+ * The data type a Kamelet turns the body into, at the step that calls it, in 
the views (CAMEL-27475): the sample of the
+ * Kamelets 4.24 blog post, where the Map of a row goes into postgresql-sink, 
which takes json.
+ */
+class KameletInputsTest {
+
+    /** As postgresql-sink of the Kamelet catalog 4.24. */
+    static final KameletInput JSON = new KameletInput(
+            "postgresql-sink", "json", "application-json", "application/json",
+            "One JSON object, or with batch a JSON array of objects, as JSON 
text in bytes.",
+            List.of("text", "bytes", "stream", "map", "list", "pojo", "null"), 
"A Json object...");
+
+    /** As csv-deserialize-action: text-plain takes no List. */
+    static final KameletInput TEXT = new KameletInput(
+            "csv-deserialize-action", "text", "text-plain", "text/plain", null,
+            List.of("text", "bytes", "stream", "file", "value", "null"), null);
+
+    @TempDir
+    Path dir;
+
+    @BeforeEach
+    void setUp() {
+        Theme.resetForTesting();
+        KameletInputs.clearForTesting();
+    }
+
+    @AfterEach
+    void tearDown() {
+        KameletInputs.clearForTesting();
+    }
+
+    private static ProcessorInfo processor(String uri, KameletInput in, 
List<String> types, List<String> kinds) {
+        ProcessorInfo p = new ProcessorInfo();
+        p.id = "to1";
+        p.processor = "to";
+        p.uri = uri;
+        p.kameletInput = in;
+        p.bodyTypes = types;
+        p.bodyKinds = kinds;
+        return p;
+    }
+
+    @Test
+    void theLabelOfAStepThatCallsAKamelet() {
+        // the Map of a row becomes the JSON that the sink takes: no warning
+        ProcessorInfo row = processor("kamelet:postgresql-sink", JSON, 
List.of("java.util.LinkedHashMap"), List.of("data"));
+        assertThat(KameletInputs.shortLabel(row)).isEqualTo("LinkedHashMap → 
json");
+        assertThat(KameletInputs.style(row)).isEqualTo(Theme.muted());
+        // before a message has reached it: what it takes
+        ProcessorInfo idle = processor("kamelet:postgresql-sink", JSON, 
List.of(), List.of());
+        assertThat(KameletInputs.shortLabel(idle)).isEqualTo("→ json");
+        // a body the transformer does not take needs attention
+        ProcessorInfo list = processor("kamelet:csv-deserialize-action", TEXT, 
List.of("java.util.ArrayList"),
+                List.of("collection"));
+        assertThat(KameletInputs.shortLabel(list))
+                .isEqualTo(BodyTypes.MARK + " ArrayList → text (text-plain 
does not take it)");
+        assertThat(KameletInputs.style(list)).isEqualTo(Theme.warning());
+        // no Kamelet: the body types alone
+        ProcessorInfo log = processor("log:out", null, List.of("byte[]"), 
List.of("payload"));
+        assertThat(KameletInputs.shortLabel(log)).isEqualTo("byte[]");
+    }
+
+    @Test
+    void theQuickDocumentationSaysWhyAMapIsFine() {
+        String doc = KameletInputs.doc(JSON, 
List.of("java.util.LinkedHashMap"), List.of("data"));
+        assertThat(doc).startsWith("The Kamelet postgresql-sink takes json: 
One JSON object")
+                .contains("with the data type transformer application-json, 
which takes text, bytes, a stream, a Map,"
+                          + " a List, a POJO or no body.")
+                .doesNotContain(BodyTypes.MARK);
+
+        String notTaken = KameletInputs.doc(TEXT, 
List.of("java.util.ArrayList"), List.of("collection"));
+        assertThat(notTaken).startsWith("The Kamelet csv-deserialize-action 
takes text.")
+                .endsWith(BodyTypes.MARK + " It does not take ArrayList: 
convert the body first.");
+    }
+
+    @Test
+    void theSourceLineOfAStepThatCallsAKamelet() {
+        RouteInfo route = new RouteInfo();
+        route.source = "csv-to-db.camel.yaml:2";
+        ProcessorInfo csv = processor("kamelet:csv-deserialize-action", TEXT, 
List.of("java.io.File"), List.of("payload"));
+        csv.source = "csv-to-db.camel.yaml:8";
+        ProcessorInfo db = processor("kamelet:postgresql-sink", JSON, 
List.of("java.util.LinkedHashMap"), List.of("data"));
+        db.source = "csv-to-db.camel.yaml:13";
+        ProcessorInfo wrong = processor("kamelet:csv-deserialize-action", 
TEXT, List.of("java.util.ArrayList"),
+                List.of("collection"));
+        wrong.source = "csv-to-db.camel.yaml:20";
+        route.processors.addAll(List.of(csv, db, wrong));
+
+        Map<Integer, LiveLine> lines = LiveRunLines.of(List.of(route), 
"/work/csv-to-db.camel.yaml");
+
+        assertThat(lines.get(7).kameletInput()).isEqualTo(TEXT);
+        assertThat(lines.get(7).mixed()).isFalse();
+        assertThat(lines.get(12).kameletInput()).isEqualTo(JSON);
+        assertThat(lines.get(12).takes()).isTrue();
+        assertThat(lines.get(12).mixed()).isFalse();
+        // a List into text-plain: the line needs attention
+        assertThat(lines.get(19).mixed()).isTrue();
+    }
+
+    @Test
+    void theSourceViewShowsTheArrowAndTheQuickDocumentation() throws Exception 
{
+        Path file = Files.writeString(dir.resolve("csv-to-db.camel.yaml"), """
+                - route:
+                    from:
+                      uri: kamelet:file-watch-source
+                      steps:
+                        - to: kamelet:postgresql-sink
+                        - to: kamelet:csv-deserialize-action
+                """);
+        SourceViewer viewer = new SourceViewer();
+        viewer.loadFile(file);
+        Map<Integer, LiveLine> data = new HashMap<>();
+        data.put(4, new LiveLine(2, 0, 0, List.of("java.util.LinkedHashMap"), 
List.of("data"), List.of(), JSON, false));
+        // reached by no message yet: what the Kamelet takes
+        data.put(5, new LiveLine(0, 0, 0, List.of(), List.of(), List.of(), 
TEXT, false));
+        viewer.liveColumn().setLiveRunData(path -> data);
+        viewer.liveColumn().refreshLiveLinesForTesting();
+
+        Rect area = new Rect(0, 0, 120, 12);
+        Buffer buffer = Buffer.empty(area);
+        viewer.render(Frame.forTesting(buffer), area);
+        String rendered = TuiTestHelper.bufferToString(buffer);
+
+        assertThat(rendered).contains("LinkedHashMap → json").contains("→ 
text");
+        List<SourceViewer.DocEntry> docs = viewer.liveColumn().docs(4);
+        
assertThat(docs).extracting(SourceViewer.DocEntry::title).containsExactly("Body 
types (data)", "Kamelet data type");
+        
assertThat(viewer.liveColumn().docs(5)).extracting(SourceViewer.DocEntry::title)
+                .containsExactly("Kamelet data type");
+    }
+
+    @Test
+    void theDiagramHasItFromTheStatus() {
+        IntegrationInfo info = new IntegrationInfo();
+        RouteInfo route = new RouteInfo();
+        route.routeId = "csv-to-db";
+        route.processors.add(processor("kamelet:postgresql-sink", JSON, 
List.of("java.util.LinkedHashMap"), List.of("data")));
+        info.routes.add(route);
+        JsonObject structure = (JsonObject) Jsoner.deserialize("""
+                {"routes": [{"routeId": "csv-to-db", "code": [
+                  {"type": "route", "id": "csv-to-db", "level": 0, "code": 
"route[csv-to-db]"},
+                  {"type": "from", "id": "from1", "level": 1, "code": 
"from[kamelet:file-watch-source]"},
+                  {"type": "to", "id": "to1", "level": 2, "code": 
"to[kamelet:postgresql-sink]"}]}]}
+                """, (JsonObject) null);
+
+        JsonObject topology = DiagramTopology.withNumbers(structure, info);
+
+        RouteDiagramLayoutEngine.NodeInfo to = 
RouteDiagramHelper.parseRoutes(topology).get(0).nodes.get(2);
+        assertThat(to.kameletInput.dataType()).isEqualTo("json");
+        assertThat(to.kameletInput.takesBody()).isTrue();
+
+        // the Info panel says what the Kamelet takes, and why the Map is fine
+        List<Line> lines = new ArrayList<>();
+        DiagramDetailSupport.addBodyTypes(lines, to, 40);
+        String text = String.join("\n", lines.stream()
+                .map(l -> l.spans().stream().map(Span::content).reduce("", 
String::concat)).toList());
+        assertThat(text).contains(" Kamelet takes: json").contains("Camel 
turns the body into it")
+                .contains("LinkedHashMap").doesNotContain(BodyTypes.MARK);
+    }
+
+    @Test
+    void theKameletsVersionOfTheIntegration() {
+        JsonObject root = (JsonObject) Jsoner.deserialize("""
+                {"context": {"name": "csv-to-db", "version": "4.24.0"},
+                 "properties": {"properties": [
+                   {"key": "camel.jbang.kameletsVersion", "value": 
"4.24.0-SNAPSHOT"},
+                   {"key": "camel.main.name", "value": "csv-to-db"}]}}
+                """, (JsonObject) null);
+
+        IntegrationInfo info = 
StatusParser.parseIntegration(ProcessHandle.current(), root);
+
+        // the Kamelets it runs, which camel run --kamelets-version may set to 
another than the Camel CLI's
+        assertThat(info.kameletsVersion).isEqualTo("4.24.0-SNAPSHOT");
+        // the camel.jbang properties stay out of the configuration
+        assertThat(info.configProperties).extracting(cp -> 
cp.key).containsExactly("camel.main.name");
+    }
+
+    @Test
+    void theKameletIsLookedUpInTheBackground() throws Exception {
+        Files.writeString(dir.resolve("my-sink.kamelet.yaml"), """
+                apiVersion: camel.apache.org/v1
+                kind: Kamelet
+                metadata:
+                  name: my-sink
+                  labels:
+                    camel.apache.org/kamelet.type: sink
+                spec:
+                  definition:
+                    title: My Sink
+                  dataTypes:
+                    in:
+                      default: json
+                      types:
+                        json:
+                          format: application-json
+                  template:
+                    from:
+                      uri: kamelet:source
+                      steps:
+                        - to: log:out
+                """);
+
+        // the first look is not known yet: the view does not wait
+        assertThat(KameletInputs.get("my-sink", dir, null)).isNull();
+        await().atMost(10, TimeUnit.SECONDS).until(() -> 
KameletInputs.get("my-sink", dir, null) != null);
+        KameletInput in = KameletInputs.get("my-sink", dir, null);
+        assertThat(in.dataType()).isEqualTo("json");
+        assertThat(in.carriers()).contains("map");
+    }
+}
diff --git 
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/test/java/org/apache/camel/dsl/jbang/core/commands/tui/diagram/BodyTypesOnArrowsTest.java
 
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/test/java/org/apache/camel/dsl/jbang/core/commands/tui/diagram/BodyTypesOnArrowsTest.java
index 4751dff700ca..e606707cb6ef 100644
--- 
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/test/java/org/apache/camel/dsl/jbang/core/commands/tui/diagram/BodyTypesOnArrowsTest.java
+++ 
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/test/java/org/apache/camel/dsl/jbang/core/commands/tui/diagram/BodyTypesOnArrowsTest.java
@@ -59,6 +59,28 @@ class BodyTypesOnArrowsTest {
         assertThat(row(buffer, mixed[1] + 2)).contains(BodyTypes.MARK);
     }
 
+    @Test
+    void theDataTypeOfTheKameletAStepCalls() {
+        // CAMEL-27475: the Map of a row becomes the JSON that postgresql-sink 
takes
+        RouteInfo route = route();
+        NodeInfo db = node("to", "to1", 1, List.of("java.util.LinkedHashMap"), 
List.of("data"));
+        db.kameletInput = new RouteDiagramLayoutEngine.KameletInputInfo(
+                "postgresql-sink", "json", "application-json", null, true);
+        route.nodes.add(db);
+        // not reached yet: what the Kamelet takes
+        NodeInfo csv = node("to", "to2", 1, List.of(), List.of());
+        csv.kameletInput = new RouteDiagramLayoutEngine.KameletInputInfo(
+                "csv-deserialize-action", "text", "text-plain", null, null);
+        route.nodes.add(csv);
+
+        Buffer buffer = render(route, true);
+
+        int[] map = find(buffer, "LinkedHashMap → json");
+        assertThat(map).isNotNull();
+        assertThat(symbol(buffer, map[0] - 2, map[1] + 1)).isEqualTo("▼");
+        assertThat(find(buffer, "→ text")).isNotNull();
+    }
+
     @Test
     void theArrowsOfABranchSideBySideCutTheTypes() {
         RouteInfo route = route();

Reply via email to