mcp-tool.stub 708 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace {{ namespace }};
  3. use Illuminate\Contracts\JsonSchema\JsonSchema;
  4. use Laravel\Mcp\Request;
  5. use Laravel\Mcp\Response;
  6. use Laravel\Mcp\Server\Attributes\Description;
  7. use Laravel\Mcp\Server\Tool;
  8. #[Description('A description of what this tool does.')]
  9. class {{ class }} extends Tool
  10. {
  11. /**
  12. * Handle the tool request.
  13. */
  14. public function handle(Request $request): Response
  15. {
  16. //
  17. return Response::text('The content generated by the tool.');
  18. }
  19. /**
  20. * Get the tool's input schema.
  21. *
  22. * @return array<string, JsonSchema>
  23. */
  24. public function schema(JsonSchema $schema): array
  25. {
  26. return [
  27. //
  28. ];
  29. }
  30. }