Skip to content

Conversation

@qingfei1994
Copy link

@qingfei1994 qingfei1994 commented Jan 17, 2026

Linked issue: #412

For MCP server without list_prompts interface, we could return the empty list from list_prompts interface
For MCPTool, remove the exclude=True parameter from the mcpServer field to ensure it is serialized

Tests

Test connecting to a McpServer without list_prompts interface

API

Yes

Documentation

  • doc-needed
  • doc-not-needed
  • doc-included

@github-actions github-actions bot added priority/major Default priority of the PR or issue. fixVersion/0.2.0 The feature or bug should be implemented/fixed in the 0.2.0 version. doc-label-missing The Bot applies this label either because none or multiple labels were provided. labels Jan 17, 2026
@github-actions
Copy link

@qingfei1994 Please add the following content to your PR description and select a checkbox:

- [ ] `doc-needed` 
- [ ] `doc-not-needed` <!-- Your PR changes do not impact docs -->
- [ ] `doc-included` 

@github-actions github-actions bot added doc-included Your PR already contains the necessary documentation updates. and removed doc-label-missing The Bot applies this label either because none or multiple labels were provided. labels Jan 17, 2026
@qingfei1994
Copy link
Author

Hi @wenjin272, could you help review this pull request? as we discussed in #434.

Copy link
Collaborator

@wenjin272 wenjin272 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, @qingfei1994. Sorry for the late reply. I see there are some ci failures related to mcp, so I thought this pr wasn't ready yet.

FAILED flink_agents/e2e_tests/e2e_tests_integration/e2e_tests_mcp/mcp_test.py::test_mcp - TypeError: 'NoneType' object is not iterable

I left some comments, and I think we need add a test case like e2e_tests_mcp/mcp_test.py which the difference is the mcp server doesn't support prompt.

- 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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think prompt is not required for calling MCP tools. The LLM understand the tools according to their metadata.

return asyncio.run(self._list_prompts_async())
try:
asyncio.run(self._list_prompts_async())
except Exception:
Copy link
Collaborator

@wenjin272 wenjin272 Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Return empty list for any exception may be too broad. Can we just return empty list for the exception that tells the mcp server doesn't support list prompt?

@wenjin272 wenjin272 added fixVersion/0.3.0 The feature or bug should be implemented/fixed in the 0.3.0 version. and removed fixVersion/0.2.0 The feature or bug should be implemented/fixed in the 0.2.0 version. labels Jan 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-included Your PR already contains the necessary documentation updates. fixVersion/0.3.0 The feature or bug should be implemented/fixed in the 0.3.0 version. priority/major Default priority of the PR or issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants