View Javadoc
1   package fr.tiogars.chat.domains.mcp.models;
2   
3   import io.swagger.v3.oas.annotations.media.Schema;
4   
5   import java.util.List;
6   import java.util.Map;
7   
8   /**
9    * Response from an MCP action execution.
10   */
11  @Schema(description = "Response from MCP action execution")
12  public record McpActionResponse(
13          @Schema(description = "Whether the action was successful")
14          boolean success,
15  
16          @Schema(description = "Result data from the action")
17          Map<String, Object> data,
18  
19          @Schema(description = "List of resources returned")
20          List<McpResource> resources,
21  
22          @Schema(description = "Error message if any")
23          String error,
24  
25          @Schema(description = "Processing time in milliseconds")
26          long processingTimeMs
27  ) {
28      public McpActionResponse {
29          if (data == null) {
30              data = Map.of();
31          }
32          if (resources == null) {
33              resources = List.of();
34          }
35      }
36  }