Description
Hi Team,
There is an issue observed when updating MCP server information using the Publisher REST APIs.
After creating an MCP server, they perform an update to modify the HTTP verb in the backendOperation section of the apiOperationMapping, as shown below:
"apiOperationMapping": {
"apiId": "21de709b-013b-49f9-a0d3-0c1210528dbb",
"apiName": "new",
"apiVersion": "2",
"apiContext": "/new/2",
"backendOperation": {
"target": "/test",
"verb": "PUT"
}
}
Although the update operation completes successfully, the Tools page of the API becomes unresponsive and displays the following error:
TypeError: Cannot read properties of undefined (reading 'toLowerCase')
at ab (ToolDetails.jsx:229:82)
Further analysis indicates that findMatchingTemplate() in ApiMgtDAO returns null because it cannot find a matching resource template for the updated HTTP verb. Since no corresponding resource entry exists for the modified verb, the MCP server definition retrieved through the GET API eventually contains a null value for apiOperationMapping.
As a result, the Publisher Portal encounters an error while rendering the Tools page, and the resource mapping table is not updated correctly. Consequently, apiOperationMapping is returned as null when the tool details are accessed.
Steps to Reproduce
We were able to consistently reproduce the issue using the following steps in WSO2 APIM 4.6.0 latest u2 level:
- Create a sample API.
- Remove the default resource and add new resources.
- Create an MCP server using "Create MCP Server from Existing API".
- Update the MCP server(update the verb to another) through the REST API and change the backend operation verb to a different HTTP method.
UUPDATE https://127.0.0.1:9443/api/am/publisher/v4/mcp-servers/be4808da-df51-464d-9637-05e773febb7e
- Open the Tools page of the MCP server.
Version
4.6.0
Environment Details (with versions)
No response
Description
Hi Team,
There is an issue observed when updating MCP server information using the Publisher REST APIs.
After creating an MCP server, they perform an update to modify the HTTP verb in the
backendOperationsection of theapiOperationMapping, as shown below:Although the update operation completes successfully, the Tools page of the API becomes unresponsive and displays the following error:
Further analysis indicates that
findMatchingTemplate()inApiMgtDAOreturnsnullbecause it cannot find a matching resource template for the updated HTTP verb. Since no corresponding resource entry exists for the modified verb, the MCP server definition retrieved through the GET API eventually contains anullvalue forapiOperationMapping.As a result, the Publisher Portal encounters an error while rendering the Tools page, and the resource mapping table is not updated correctly. Consequently,
apiOperationMappingis returned asnullwhen the tool details are accessed.Steps to Reproduce
We were able to consistently reproduce the issue using the following steps in WSO2 APIM 4.6.0 latest u2 level:
UUPDATE
https://127.0.0.1:9443/api/am/publisher/v4/mcp-servers/be4808da-df51-464d-9637-05e773febb7eVersion
4.6.0
Environment Details (with versions)
No response