Skip to main content
Glama
GetBreakingChangeDetailsTool.php2.59 kB
<?php declare(strict_types=1); namespace GoldenPathDigital\LaravelAscend\Tools\Documentation; use GoldenPathDigital\LaravelAscend\Documentation\DocumentationException; use GoldenPathDigital\LaravelAscend\Documentation\KnowledgeBaseService; use GoldenPathDigital\LaravelAscend\Tools\AbstractTool; final class GetBreakingChangeDetailsTool extends AbstractTool { /** @var KnowledgeBaseService */ private $knowledgeBase; public function __construct( KnowledgeBaseService $knowledgeBase ) { $this->knowledgeBase = $knowledgeBase; } public function getName(): string { return 'get_breaking_change_details'; } public function getDescription(): string { return 'Fetch the details for a specific breaking change in a given Laravel release.'; } public function getInputSchema(): array { return $this->buildSchema( [ 'id' => [ 'type' => 'string', 'description' => 'Breaking change identifier (e.g. "symfony-5-method-signatures").', ], 'version' => [ 'type' => 'string', 'description' => 'Laravel release that contains the breaking change (e.g. "8.x").', ], ], ['id', 'version'] ); } /** * @param array<string, mixed> $payload * * @return array<string, mixed> */ public function execute(array $payload): array { $startedAt = microtime(true); $changeId = isset($payload['id']) ? (string) $payload['id'] : ''; $version = isset($payload['version']) ? (string) $payload['version'] : ''; if ($changeId === '' || $version === '') { return $this->error('Parameters "id" and "version" are required.', [], $startedAt, 'invalid_request'); } try { $slug = $this->knowledgeBase->resolveBreakingChangeSlug($version); $document = $this->knowledgeBase->getBreakingChangeDocument($slug); $entry = $this->knowledgeBase->getBreakingChangeEntry($slug, $changeId); } catch (DocumentationException $exception) { return $this->error($exception->getMessage(), [], $startedAt, 'not_found'); } $data = [ 'slug' => $slug, 'version' => $document['version'] ?? $version, 'from_version' => $document['from_version'] ?? null, 'change' => $entry, ]; return $this->success($data, [], $startedAt); } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/aarongrtech/laravel-ascend'

If you have feedback or need assistance with the MCP directory API, please join our Discord server