McpToolGroup

class McpToolGroup(description: ToolGroupDescription, provider: String, name: String, permissions: Set<ToolGroupPermission>, clients: List<<Error class: unknown class>>, filter: (<Error class: unknown class>) -> Boolean, metaConverter: ToolCallContextMcpMetaConverter = ToolCallContextMcpMetaConverter.passThrough()) : ToolGroup

ToolGroup backed by MCP.

Tools are loaded lazily on first access rather than at construction time. This is required when MCP clients are configured with spring.ai.mcp.client.initialized=false so that the user's OAuth token is present in the security context when the MCP handshake occurs.

Kotlin's lazy delegate uses LazyThreadSafetyMode.SYNCHRONIZED by default, so concurrent first-access across threads is safe without additional locking.

Parameters

description

Description of the tool group

provider

Name of the provider of the tool group

name

Name of the tool group

permissions

Permissions the tools requires

clients

List of MCP clients to use to load tools

filter

predicate that returns true to include a tool

Constructors

Link copied to clipboard
constructor(description: ToolGroupDescription, provider: String, name: String, permissions: Set<ToolGroupPermission>, clients: List<<Error class: unknown class>>, filter: (<Error class: unknown class>) -> Boolean, metaConverter: ToolCallContextMcpMetaConverter = ToolCallContextMcpMetaConverter.passThrough())

Properties

Link copied to clipboard
open override val metadata: ToolGroupMetadata
Link copied to clipboard
open override val tools: List<Tool>

Lazily loaded tool list. The first call to this property triggers the MCP client handshake (listTools), which happens during action execution when the user's security context — and therefore their OAuth token — is available.

Functions

Link copied to clipboard
open fun infoString(verbose: Boolean?, indent: Int): String
Link copied to clipboard
open override fun toString(): String