Skip to content

Conversation

@pushpak1300
Copy link
Member

This PR updates the codebase to rely on the JsonSchema contract interface instead of the concrete implementation class. This improves the autocompletion.

Caution

Warning: Breaking Change

Tool implementations that explicitly type hint Illuminate\JsonSchema\JsonSchema in their schema() or outputSchema() methods must update to use the contract interface Illuminate\Contracts\JsonSchema\JsonSchema.

Migration Guide

// Before
use Illuminate\JsonSchema\JsonSchema;

public function schema(JsonSchema $schema): array
{
   //
}
// After
use Illuminate\Contracts\JsonSchema\JsonSchema;

public function schema(JsonSchema $schema): array
{
   //
}

This affects only custom tool classes that override the schema methods. The update is minimal, limited to changing the import to the contract interface.

@pushpak1300 pushpak1300 marked this pull request as ready for review November 28, 2025 18:46
@taylorotwell taylorotwell merged commit 2e662d0 into main Nov 28, 2025
20 checks passed
@taylorotwell taylorotwell deleted the update_jsonschema_contract branch November 28, 2025 18:53
@alankpax
Copy link

alankpax commented Dec 5, 2025

Hi @pushpak1300 , I have just tried to upgrade the package like this

composer require laravel/mcp:0.4.1

on an existing project wich was using Laravel framework in version 12.37

"laravel/framework": "^12.37",

I have come with the issue that Illuminate\Contracts\JsonSchema\JsonSchema is not found on my existing tools.

Shouldn't this PR adds a minimal version of Laravel 12 since this contract looked to be added on a very recent minimal version ?

use Illuminate\Contracts\JsonSchema\JsonSchema;

@pushpak1300
Copy link
Member Author

@alankpax you're right i think we should do that but for this specific issue you can just run composer update and this will be solve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants