MCPToolRegistry

org.llm4s.mcp.MCPToolRegistry
See theMCPToolRegistry companion object
class MCPToolRegistry(mcpServers: Seq[MCPServerConfig], localTools: Seq[ToolFunction[_, _]], cacheTTL: Duration, initializeOnStartup: Boolean) extends ToolRegistry, AutoCloseable

Attributes

Companion
object
Graph
Supertypes
trait AutoCloseable
class ToolRegistry
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def clearCache(): Unit
override def close(): Unit

Attributes

Definition Classes
AutoCloseable
def closeMCPClients(): Unit
override def execute(request: ToolCallRequest): Either[ToolCallError, Value]

Attributes

Definition Classes
def getAllTools: Seq[ToolFunction[_, _]]
override def getOpenAITools(strict: Boolean): Arr

Attributes

Definition Classes
def healthCheck(): Map[String, Boolean]
def refreshCache(): Unit
override def tools: Seq[ToolFunction[_, _]]

Attributes

Definition Classes

Inherited methods

def addToAzureOptions(chatOptions: ChatCompletionsOptions): ChatCompletionsOptions

Adds the tools from this registry to an Azure OpenAI ChatCompletionsOptions

Adds the tools from this registry to an Azure OpenAI ChatCompletionsOptions

Value parameters

chatOptions

The chat options to add the tools to

Attributes

Returns

The updated chat options

Inherited from:
ToolRegistry
def executeAll(requests: Seq[ToolCallRequest], strategy: ToolExecutionStrategy)(implicit ec: ExecutionContext): Future[Seq[Either[ToolCallError, Value]]]

Execute multiple tool calls with a configurable strategy.

Execute multiple tool calls with a configurable strategy.

Value parameters

ec

ExecutionContext for async execution

requests

The tool call requests to execute

strategy

Execution strategy (Sequential, Parallel, or ParallelWithLimit)

Attributes

Returns

Future containing results in the same order as requests

Inherited from:
ToolRegistry
def executeAsync(request: ToolCallRequest)(implicit ec: ExecutionContext): Future[Either[ToolCallError, Value]]

Execute a tool call asynchronously.

Execute a tool call asynchronously.

Wraps synchronous execution in a Future for non-blocking operation.

Value parameters

ec

ExecutionContext for async execution

request

The tool call request

Attributes

Returns

Future containing the result

Inherited from:
ToolRegistry
def getTool(name: String): Option[ToolFunction[_, _]]

Attributes

Inherited from:
ToolRegistry
def getToolDefinitions(provider: String): Value

Attributes

Inherited from:
ToolRegistry