Skip to content

Prompts and Resources auto-discovery #62

@alejandro-alarcon-t

Description

@alejandro-alarcon-t

Feature Request

I think it would be useful to have some get_resources(...) and get_prompts(...) methods, that similarly to what we do for tools, allow the agents to discover all the features that are available and at their service from the MCP server.

I've seen the resources part is being covered in PR #43, but I think it could be nice to have something similar for the prompts.

Expected Functionality

  • A new method get_prompts that allows for auto-discovery of prompts similar to get_tools and get_resources.
  • This method should return a list of all available prompts from the MCP server, including the name, description, and necessary fields for completion, but not the prompt content itself. This way, the agent can know that there is a prompt available for a specific task or use-case.

Use Case

This feature would make it easier to manage and utilize prompts within the LangChain framework, enhancing the overall user experience and efficiency. For example, an agent could auto-discover available prompts and select the most appropriate one based on the context, without hardcoding specific prompt names.

Examples

# Example usage of get_prompts
prompts = mcp_client.get_prompts()
for prompt in prompts:
    print(f"Name: {prompt['name']}")
    print(f"Description: {prompt['description']}")
    print(f"Fields: {prompt['fields']}")

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions