setServerInfo('integration-server', '1.0.0') ->addTool( static function (RequestContext $context): string { $gateway = $context->getClientGateway(); if (!$gateway->supportsElicitation()) { return 'unsupported'; } try { $result = $gateway->elicit('What is your name?', new ElicitationSchema([ 'name' => new StringSchemaDefinition(title: 'Name'), ])); } catch (ClientException $e) { return $e->getMessage(); } return sprintf('%s:%s', $result->action->value, $result->content['name'] ?? ''); }, name: 'ask_name', description: 'Asks the client for a name.', ) ->build() ->run(new StdioTransport());