Skip to content

Commit 3c70c5c

Browse files
committed
refactor: rename ToolExecutor references to ToolCaller
1 parent e11c0c1 commit 3c70c5c

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

src/Capability/Tool/ToolCaller.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
use Psr\Log\NullLogger;
2626

2727
/**
28-
* Default implementation of ToolExecutorInterface that uses ReferenceProvider
28+
* Default implementation of ToolCallerInterface that uses ReferenceProvider
2929
* and ReferenceHandlerInterface to execute tools.
3030
*
3131
* @author Pavel Buchnev <[email protected]>

src/JsonRpc/Handler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public static function make(
5959
ReferenceRegistryInterface $registry,
6060
ReferenceProviderInterface $referenceProvider,
6161
Implementation $implementation,
62-
ToolCallerInterface $toolExecutor,
62+
ToolCallerInterface $toolCaller,
6363
ResourceReaderInterface $resourceReader,
6464
PromptGetterInterface $promptGetter,
6565
LoggerInterface $logger = new NullLogger(),
@@ -74,7 +74,7 @@ public static function make(
7474
new RequestHandler\GetPromptHandler($promptGetter),
7575
new RequestHandler\ListResourcesHandler($referenceProvider),
7676
new RequestHandler\ReadResourceHandler($resourceReader),
77-
new RequestHandler\CallToolHandler($toolExecutor, $logger),
77+
new RequestHandler\CallToolHandler($toolCaller, $logger),
7878
new RequestHandler\ListToolsHandler($referenceProvider),
7979
],
8080
logger: $logger,

src/Server/RequestHandler/CallToolHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
final class CallToolHandler implements MethodHandlerInterface
2929
{
3030
public function __construct(
31-
private readonly ToolCallerInterface $toolExecutor,
31+
private readonly ToolCallerInterface $toolCaller,
3232
private readonly LoggerInterface $logger = new NullLogger(),
3333
) {
3434
}
@@ -43,7 +43,7 @@ public function handle(CallToolRequest|HasMethodInterface $message): Response|Er
4343
\assert($message instanceof CallToolRequest);
4444

4545
try {
46-
$content = $this->toolExecutor->call($message);
46+
$content = $this->toolCaller->call($message);
4747
} catch (ExceptionInterface $exception) {
4848
$this->logger->error(
4949
\sprintf('Error while executing tool "%s": "%s".', $message->name, $exception->getMessage()),

src/Server/ServerBuilder.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ final class ServerBuilder
5555

5656
private ?CacheInterface $cache = null;
5757

58-
private ?ToolCallerInterface $toolExecutor = null;
58+
private ?ToolCallerInterface $toolCaller = null;
5959

6060
private ?ResourceReaderInterface $resourceReader = null;
6161

@@ -161,9 +161,9 @@ public function withEventDispatcher(EventDispatcherInterface $eventDispatcher):
161161
return $this;
162162
}
163163

164-
public function withToolExecutor(ToolCallerInterface $toolExecutor): self
164+
public function withToolCaller(ToolCallerInterface $toolCaller): self
165165
{
166-
$this->toolExecutor = $toolExecutor;
166+
$this->toolCaller = $toolCaller;
167167

168168
return $this;
169169
}
@@ -281,7 +281,7 @@ public function build(): Server
281281
$registry = new Registry($this->eventDispatcher, $logger);
282282

283283
$referenceHandler = new ReferenceHandler($container);
284-
$toolExecutor = $this->toolExecutor ??= new ToolCaller($registry, $referenceHandler, $logger);
284+
$toolCaller = $this->toolCaller ??= new ToolCaller($registry, $referenceHandler, $logger);
285285
$resourceReader = $this->resourceReader ??= new ResourceReader($registry, $referenceHandler, $logger);
286286
$promptGetter = $this->promptGetter ??= new PromptGetter($registry, $referenceHandler, $logger);
287287

@@ -297,7 +297,7 @@ public function build(): Server
297297
registry: $registry,
298298
referenceProvider: $registry,
299299
implementation: $this->serverInfo,
300-
toolExecutor: $toolExecutor,
300+
toolCaller: $toolCaller,
301301
resourceReader: $resourceReader,
302302
promptGetter: $promptGetter,
303303
logger: $logger,

0 commit comments

Comments
 (0)