McpToolset

class McpToolset(servers: List<McpServerConfig>, clientFor: (McpServerConfig) -> McpClient, timeoutMs: Long, cacheMs: Long = 5 * 60_000, now: () -> Long = System::currentTimeMillis) : Capability(source)

The enabled MCP servers as a Capability: their tools, listed in parallel with a timeoutMs per server. A server that fails is skipped (see status) instead of failing the turn. Tool lists are cached for cacheMs; invalidate forces a refresh.

Parameters

clientFor

the client of a server (reuse instances: they cache the protocol era and session).

Constructors

Link copied to clipboard
constructor(servers: List<McpServerConfig>, clientFor: (McpServerConfig) -> McpClient, timeoutMs: Long, cacheMs: Long = 5 * 60_000, now: () -> Long = System::currentTimeMillis)

Properties

Link copied to clipboard
open val instructions: String?

Guidance for the model, or null.

Link copied to clipboard

Last listing result per server id.

Functions

Link copied to clipboard
open suspend fun context(): String?

Per-turn context read when a turn starts (e.g. a memory snapshot), placed after the static instructions. It may change between turns, so keep it small and at the end.

Link copied to clipboard
Link copied to clipboard
open suspend override fun tools(): List<AgentTool>

Tools the capability contributes.