Skip to content

Conversation

@omarsrepo
Copy link

Added new code into the initialize() method of the MCPTools() class to fetch and list mcp server prompts and make it available to the agent as part of the MCPTools tooklit. Added a new get_entrypoint_for_prompt() function and imported it into MCPTools() class to aid in the above changes.

Summary

MCPTools() class only imported tools from an MCP server. The new code should help MCP servers expose their prompts (at least for custom MCP servers written with the python SDK).

Type of change

  • Improvement

Checklist

  • Code complies with style guidelines
  • Ran format/validation scripts (./scripts/format.sh and ./scripts/validate.sh)
  • Self-review completed
  • Documentation updated (comments, docstrings)
  • Examples and guides: Relevant cookbook examples have been included or updated (if applicable)
  • Tested in clean environment
  • Tests added/updated (if applicable)

Additional Notes

Added new code into the `initialize()` method of the `MCPTools()` class to fetch and list mcp server prompts and make it available to the agent as part of the MCPTools tooklit.
Added a new `get_entrypoint_for_prompt()` function and imported it into MCPTools() class to aid in the above changes.
@omarsrepo omarsrepo requested a review from a team as a code owner October 28, 2025 06:27

# Create a Function for the prompt (just like tools!)
f = Function(
name=f"{prompt.name}",
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be a something like get_{prompt.name} because we are basically telling the agent "here is a tool to get a prompt".
Right?

Copy link
Contributor

@dirkbrnd dirkbrnd left a comment

Choose a reason for hiding this comment

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

I don't know much about how this works, but it looks good. If we could get a cookbook that illustrates the functionality, that would help a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants