wenjin272 commented on code in PR #447:
URL: https://github.com/apache/flink-agents/pull/447#discussion_r2735038022
##########
docs/content/docs/development/mcp.md:
##########
@@ -187,4 +187,5 @@ public class ReviewAnalysisAgent extends Agent {
**Key points:**
- All tools and prompts from the MCP server are automatically registered.
-- Reference MCP prompts and tools by their names, like reference [local
prompt]({{< ref "docs/development/prompts#using-prompts-in-agents" >}}) and
[function tool]({{< ref
"docs/development/tool_use#define-tool-as-static-method-in-agent-class" >}}) .
\ No newline at end of file
+- Reference MCP prompts and tools by their names, like reference [local
prompt]({{< ref "docs/development/prompts/#using-prompts-in-agents" >}}) and
[function tool]({{< ref
"docs/development/tool_use/#define-tool-as-static-method-in-agent-class" >}}) .
+- For MCP servers that do not support the list_prompts interface, the
list_prompts method will return an empty list. In such cases, you need to
define a LocalPrompt to call the tools.
Review Comment:
I think prompt is not required for calling MCP tools. The LLM understand the
tools according to their metadata.
##########
python/flink_agents/integrations/mcp/mcp.py:
##########
@@ -271,7 +271,10 @@ def get_tool_metadata(self, name: str) -> ToolMetadata:
def list_prompts(self) -> List[MCPPrompt]:
"""List available prompts from the MCP server."""
- return asyncio.run(self._list_prompts_async())
+ try:
+ asyncio.run(self._list_prompts_async())
+ except Exception:
Review Comment:
Return empty list for any exception may be too board. Can we just return
empty list for the exception that tells the mcp server doesn't support list
prompt?
--
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]