avichaym opened a new pull request, #539:
URL: https://github.com/apache/flink-agents/pull/539

   Linked issue: #538
   
   ## What is the purpose of the change
   
   Fix Java agents failing with `McpError: Method not found` when connecting to 
MCP servers that don't support prompts (e.g., AgentCore Gateway). PR #447 fixed 
the Python path (#412) but the Java path in `AgentPlan.extractJavaMCPServer` 
was not addressed.
   
   ## Brief change log
   
   - Add `MCPServer.supportsPrompts()` — checks 
`McpSyncClient.getServerCapabilities().prompts() != null`
   - Guard `listPrompts` call in `AgentPlan.extractJavaMCPServer` with 
`supportsPrompts()` via reflection
   - Add unit test verifying `supportsPrompts` method exists and is 
reflection-callable
   
   ## Does this pull request potentially affect one of the following parts
   
   - Runtime / Operators: no
   - Plan: yes (AgentPlan.extractJavaMCPServer)
   - Integrations / MCP: yes (MCPServer.supportsPrompts)
   
   ## How was this patch tested?
   
   - Unit test: `MCPServerTest.testSupportsPromptsMethodExists`
   - End-to-end: Tested with Amazon Bedrock AgentCore Gateway (tools-only MCP 
server, `capabilities.prompts=null`). Agent plan creation succeeds, tools are 
discovered, Flink job completes successfully.
   
   ### Documentation
   
   - [x] `doc-not-needed`
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to