Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Group ¶
type Group struct {
GroupConfig
// contains filtered or unexported fields
}
Group is an initialized group: the source of truth for a named collection of tools and prompts. It is a self-contained MCP primitive and does not depend on the legacy toolset/promptset types. It keeps O(1) membership sets for its tools and prompts; per-tool and per-prompt manifests are generated on demand by callers from the resolved tools and prompts maps.
func NewGroup ¶
func NewGroup(config GroupConfig) Group
NewGroup builds a Group directly from its config, deriving the membership sets from the declared tool and prompt names. It skips the existence checks performed by GroupConfig.Initialize and is intended for tests and callers that have already validated the names.
func (Group) ContainsPrompt ¶
ContainsPrompt reports whether the group includes a prompt with the given name.
func (Group) ContainsTool ¶
ContainsTool reports whether the group includes a tool with the given name.
func (Group) ToolsetManifest ¶
func (g Group) ToolsetManifest(serverVersion string, mgr GroupManager) (tools.ToolsetManifest, error)
ToolsetManifest builds a tools.ToolsetManifest for the group's tools, resolving each declared tool name against toolsMap and generating its manifest from srcs. The group holds tool names rather than tool pointers, so callers pass the resolved tools and sources maps.
type GroupConfig ¶
type GroupConfig struct {
Name string `yaml:"name"`
Description string `yaml:"description"`
ToolNames []string `yaml:"tools"`
PromptNames []string `yaml:"prompts"`
}
GroupConfig is the parsed configuration for a group: a single named collection that holds both tools and prompts. Its description doubles as the MCP server instructions for clients connected to the group.
func (GroupConfig) Initialize ¶
func (gc GroupConfig) Initialize(toolsMap map[string]tools.Tool, promptsMap map[string]prompts.Prompt) (Group, error)
Initialize validates the group name and checks that every declared tool and prompt exists in the provided maps, building the membership sets used by ContainsTool and ContainsPrompt.