. */ declare(strict_types=1); namespace App\Services\InfoProviderSystem\DTOs; use ApiPlatform\Metadata\ApiResource; use ApiPlatform\Metadata\McpToolCollection; use App\Mcp\DTO\ListInfoProvidersInput; use App\State\Mcp\ListInfoProvidersProcessor; /** * This DTO represents an available info provider (a distributor or manufacturer catalog which can be * searched via search_info_providers / get_info_provider_part_details). */ #[ApiResource( description: 'An info provider which can be used to search for parts and retrieve part details.', operations: [], mcp: [ 'list_info_providers' => new McpToolCollection( title: 'List available info providers', description: 'List the info providers (e.g. distributors like Digikey, Mouser, LCSC) which are currently active and can be used with search_info_providers and get_info_provider_part_details.', annotations: ['readOnlyHint' => true, 'destructiveHint' => false, 'idempotentHint' => true, 'openWorldHint' => false], input: ListInfoProvidersInput::class, security: 'is_granted("@info_providers.create_parts")', processor: ListInfoProvidersProcessor::class, ), ], )] readonly class InfoProviderDTO { public function __construct( /** @var string The unique key of the provider, to be used as provider_key in the other info provider tools */ public string $key, /** @var string The (user friendly) name of the provider (e.g. "Digikey") */ public string $name, /** @var string|null A short description of the provider */ public ?string $description = null, /** @var string|null The url of the provider (e.g. "https://www.digikey.com") */ public ?string $url = null, /** @var string[] The kinds of data this provider can supply (e.g. "PRICE", "DATASHEET", "PICTURE") */ public array $capabilities = [], ) { } }