@@ -4060,6 +4060,25 @@ ObjectNode maskReferenceConfigToVertex(
40604060 return toObject ;
40614061 }
40624062
4063+ @ ExcludeFromGeneratedCoverageReport
4064+ ObjectNode mcpServerToVertex (JsonNode fromObject , ObjectNode parentObject , JsonNode rootObject ) {
4065+ ObjectNode toObject = JsonSerializable .objectMapper ().createObjectNode ();
4066+ if (!Common .isZero (Common .getValueByPath (fromObject , new String [] {"name" }))) {
4067+ throw new IllegalArgumentException (
4068+ "name parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise"
4069+ + " Agent Platform mode." );
4070+ }
4071+
4072+ if (!Common .isZero (
4073+ Common .getValueByPath (fromObject , new String [] {"streamableHttpTransport" }))) {
4074+ throw new IllegalArgumentException (
4075+ "streamableHttpTransport parameter is only supported in Gemini Developer API mode, not in"
4076+ + " Gemini Enterprise Agent Platform mode." );
4077+ }
4078+
4079+ return toObject ;
4080+ }
4081+
40634082 @ ExcludeFromGeneratedCoverageReport
40644083 ObjectNode modelFromMldev (JsonNode fromObject , ObjectNode parentObject , JsonNode rootObject ) {
40654084 ObjectNode toObject = JsonSerializable .objectMapper ().createObjectNode ();
@@ -5200,10 +5219,16 @@ ObjectNode toolToVertex(JsonNode fromObject, ObjectNode parentObject, JsonNode r
52005219 Common .getValueByPath (fromObject , new String [] {"urlContext" }));
52015220 }
52025221
5203- if (!Common .isZero (Common .getValueByPath (fromObject , new String [] {"mcpServers" }))) {
5204- throw new IllegalArgumentException (
5205- "mcpServers parameter is only supported in Gemini Developer API mode, not in Gemini"
5206- + " Enterprise Agent Platform mode." );
5222+ if (Common .getValueByPath (fromObject , new String [] {"mcpServers" }) != null ) {
5223+ ArrayNode keyArray =
5224+ (ArrayNode ) Common .getValueByPath (fromObject , new String [] {"mcpServers" });
5225+ ObjectMapper objectMapper = new ObjectMapper ();
5226+ ArrayNode result = objectMapper .createArrayNode ();
5227+
5228+ for (JsonNode item : keyArray ) {
5229+ result .add (mcpServerToVertex (JsonSerializable .toJsonNode (item ), toObject , rootObject ));
5230+ }
5231+ Common .setValueByPath (toObject , new String [] {"mcpServers" }, result );
52075232 }
52085233
52095234 return toObject ;
0 commit comments