Skip to content

Conversation

@ravitemer
Copy link
Contributor

Description

system_prompt of tools.groups being a function makes it dynamic and the following possible.

        groups = {
            mcp = {
                description = "MCP Servers Tool",
                system_prompt = function(_)
                    -- get the running hub instance
                    local hub = require("mcphub").get_hub_instance()
                    return hub:get_active_servers_prompt() -- generates prompt from currently running mcp servers
                end,
                tools = {"use_mcp_tool","access_mcp_resource"},
            },
        },

Related Issue(s)

Screenshots

Checklist

  • I've read the contributing guidelines and have adhered to them in this PR
  • I've updated the README and/or relevant docs pages
  • I've run make docs to update the vimdoc pages

@olimorris olimorris merged commit 825f5ea into olimorris:main Apr 5, 2025
5 checks passed
cleong14 pushed a commit to cleong14/codecompanion.nvim that referenced this pull request May 21, 2025
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