A2A External Agent — kind: "data" response ignored by LLM, kind: "text" works fine

Hello All,

Need your suggestion.

I have two external A2A agents on the same server. Identical setup except one returns kind: "text" with type: "text"and the other returns kind: "data" with type: "application/json". The kind: "text" agent works perfectly — the LLM reads and presents its response in Pega. The kind: "data" agent is silently ignored by the LLM — it responds as if the tool call never happened. Both return HTTP 200.

I can see in normal tracer that the response is received from external agent successfully in both the scenarios. BUT, in AI tracer/Autopilot Conversation instance, tool output is blank when kind= data - {"tool_output": "", "tool_execution_status": "success"}

Pega Version Infinity 26.1.1
Rule Types Rule-AI-Agent, Rule-Connect-Agent
A2A Protocol Version 0.3.0
External Agent Python / Flask, ngrok tunnel
LLM pega-default-smart
Channel Web (Constellation chat widget)

External agent response which Pega understood: (WORKING)


{
  "id": "1064b0ab-3b32-47ae-b7a1-760cdf9a7fd1",
  "jsonrpc": "2.0",
  "result": {
    "artifacts": [
      {
        "index": 0,
        "name": "agent-analysis",
        "parts": [
          {
            "kind": "text",
            "text": "**Status:**\nWe are currently behind target \n\n**Risk:**\nThe main risk is not meeting the target production deadline, .\n\n**Recommendation:**\nIncrease production efforts to maximize the projected output .",
            "type": "text"
          }
        ]
      }
    ],
    "id": "MSG-082032ba-de55-481b-b035-414f88eb10ca",
    "kind": "task",
    "status": {
      "state": "completed"
    }
  }
}

External agent response which Pega did not displayed: ( NOT WORKING)



{
   "id": "b7c96811-bb34-44d4-9e26-61b0419679e3",
  "jsonrpc": "2.0",
  "result": {
    "artifacts": [
      {
        "index": 0,
        "name": "json-test",
        "parts": [
          {
            "kind": "data",
            "type": "application/json",
            "data": {
              "machine": "CNC101",
              "recommendation": "Immediate maintenance required",
              "riskLevel": "HIGH",
              "temperature": 92
            }
          }
        ]
      }
    ],
    "id": "json-test-001",
    "kind": "task",
    "status": {
      "state": "completed"
    }
  }

}

I tried looking for option to use a data transform to deserialize the data, but could not find any place to hook that DT. I have only 2 rules in Pega - one Agent and Connect-Agent rule. I am invoking the external agent directly from Agent window.

Let me know if you have used A2A with kind as data and response as json/key-value pair.

@PIYUSH_SINHA Have you added specific instructions on how to consume the response of the external agent in the main agent. For instance something like - summarise the machines list along with the risk and recommendations. If you have such instructions, it will try to include them in the final output. Let me know how it goes.

Not working response - doesn’t have parts[].text. Again, based on my knowledge, it always required to have parts.text for a valid response from external agents.

Hi @Murali.Krishnan.D ,

The response from external agent in json format did not reached back to the main agent.

Pega is ignoring the response from connect agent.

@RameshSangili - Agree, I can see in OOTB final activity of agent - there is a logic which is accepting only text() which could be a reason for not getting the response to reach back.

String kind = root.path(“result”).path(“kind”).asText(); and many more java code for text.

How to raise this to product team and get clarity if it needs enhancement (OR) should be considered as limitation ? as json is widely used in Industry A2A agents