Skip to content

Commit 85c9909

Browse files
author
Anne-Julia Seitz
committed
fix(console): exists
1 parent e2f22eb commit 85c9909

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

src/Tool/Console.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Dazz\PhpMcpTools\Tool;
6+
7+
use PhpLlm\LlmChain\Chain\Toolbox\Attribute\AsTool;
8+
9+
#[AsTool(name: 'console_exists', description: 'Check if the executable is available in the project', method: 'exists')]
10+
final readonly class Console
11+
{
12+
public function __construct(private string $consoleExecutable)
13+
{
14+
}
15+
16+
public function exists(): string
17+
{
18+
return $this->isExecutableExisting() ? 'executable exists' : 'executable not found';
19+
}
20+
21+
private function isExecutableExisting(): bool
22+
{
23+
return file_exists($this->consoleExecutable);
24+
}
25+
}

0 commit comments

Comments
 (0)