Skip to content

[BUG] Update agent API fails for several scenarios with MCP connectors #4321

@ohltyler

Description

@ohltyler

The update agent API fails and returns parsing errors for some different scenarios I've been able to find; there may be more:

  1. Updating an agent that previously had no MCP connectors -> adding MCP connectors
  2. Updating an agent with existing MCP connectors -> updating any part of the agent (not exclusive to updating MCP connectors), as long as the MCP connector array is still passed in the request body.

Returns something like below at REST level. And same in logs.

Error updating agent: [illegal_state_exception] Can't get text on a START_ARRAY at 1:377

From what I can find, the root issue is due to the fact that the array of MCP connectors are stored as strings after indexed in the system index. If I manually stringify the array within the update agent API body, it looks to succeed. But, this is not user-friendly, and also is not consistent with the create agent API, which can take a regular array as input.

I feel the MCP connectors should be a standalone field within an agent, instead of nested under parameters, which I believe is the reason it has to be stringified (not sure on this part)? It's not so user friendly when viewing the agent configs, and have the MCP connectors field be harder to read and not consistent with other configs of an agent, like the array of tools for example.

At the least, the update agent API should be able to handle arrays for the MCP connectors field. Let's discuss more on what's the right approach or most feasible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions