Skip to content
docsv0.1.0

McpClientService

Facade over a {@see ToolRegistry} that shapes it for {@see AgentOrchestrator}: summaries for the LLM's tool list and context-aware invocation.

McpClientService::__construct()

public function __construct(Milpa\ToolRuntime\ToolRegistry $internalRegistry):

Parameters

Parameters of __construct()
NameTypeDescription
$internalRegistryMilpa\ToolRuntime\ToolRegistry

McpClientService::setContext()

public function setContext(Milpa\ToolRuntime\Contracts\ToolContext $context): void

Set the execution context for tool calls. This should be called before processing a request to set the user's identity and scopes.

Parameters

Parameters of setContext()
NameTypeDescription
$contextMilpa\ToolRuntime\Contracts\ToolContext

McpClientService::getContext()

public function getContext(): ?Milpa\ToolRuntime\Contracts\ToolContext

Get the current context.

McpClientService::getToolSummaries()

public function getToolSummaries(): array

Get the plain-array tool summaries for LLM/MCP exposure. Delegates to {@see ToolRegistry::getToolSummaries()} — named to match that vocabulary since tool-runtime 0.2 (was `getTools()` through 0.1). In the future, merge with external tools fetched via HTTP/SSE.

McpClientService::callTool()

public function callTool(string $name, array $args): ?mixed

Execute a tool by name through the underlying registry pipeline.

Parameters

Parameters of callTool()
NameTypeDescription
$namestring
$argsarray<string, mixed>