PHP code example of jelte-ten-holt / in-other-agents
1. Go to this page and download the library: Download jelte-ten-holt/in-other-agents library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
jelte-ten-holt / in-other-agents example snippets
namespace App\Mcp\Tools;
use InOtherAgents\AgentTool;
final class Ping extends AgentTool
{
public static function identifier(): string
{
return 'ping';
}
public static function displayName(): string
{
return 'Ping';
}
public function description(): string
{
return 'Health check — returns pong.';
}
public function inputSchema(): array
{
return [
'type' => 'object',
'properties' => new \stdClass(),
];
}
public function __invoke(array $arguments): array
{
return ['result' => 'pong'];
}
}