- Introduced a new code snippets resource for common FiveM patterns in Lua and JavaScript. - Added a framework comparison document outlining Standalone, ESX, and QBCore features. - Created search results view for FiveM documentation queries. - Developed client and server template scripts for ESX and QBCore frameworks. - Implemented NUI templates including HTML, CSS, and JavaScript for user interfaces. - Established routes for documentation and console commands. - Added tests for various features including documentation routes and tool functionalities. - Configured Vite for asset management with Laravel. - Updated .gitignore files for storage and framework directories.
55 lines
1.6 KiB
PHP
55 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace App\Mcp\Prompts;
|
|
|
|
use Illuminate\Contracts\JsonSchema\JsonSchema;
|
|
use Laravel\Mcp\Request;
|
|
use Laravel\Mcp\Response;
|
|
use Laravel\Mcp\Server\Attributes\Description;
|
|
use Laravel\Mcp\Server\Prompt;
|
|
|
|
#[Description('Debug common FiveM issues and errors')]
|
|
class DebugIssues extends Prompt
|
|
{
|
|
public function handle(Request $request): Response
|
|
{
|
|
$issue = $request->get('issue', '');
|
|
$errorMessage = $request->get('error_message', '');
|
|
|
|
$parts = ["Help me debug a FiveM issue:\n\n"];
|
|
|
|
if ($issue) {
|
|
$parts[] = sprintf("Issue Description: %s\n\n", $issue);
|
|
}
|
|
|
|
if ($errorMessage) {
|
|
$parts[] = sprintf("Error Message: %s\n\n", $errorMessage);
|
|
}
|
|
|
|
$parts[] = sprintf(
|
|
"%s\n%s\n%s\n%s\n%s\n%s\n\n%s",
|
|
"Please analyze this issue and:",
|
|
"1. Identify the likely cause",
|
|
"2. Suggest fixes with code examples",
|
|
"3. Explain common mistakes that lead to this issue",
|
|
"4. Provide preventive measures",
|
|
"5. Reference FiveM best practices if applicable",
|
|
"Use the SearchFiveMDocs and GetNativeFunction tools to find relevant information."
|
|
);
|
|
|
|
return Response::prompt(implode('', $parts));
|
|
}
|
|
|
|
public function schema(JsonSchema $schema): array
|
|
{
|
|
return [
|
|
'issue' => $schema->string()
|
|
->description('Description of the issue or problem')
|
|
->default(''),
|
|
'error_message' => $schema->string()
|
|
->description('Error message from console or logs')
|
|
->default(''),
|
|
];
|
|
}
|
|
}
|