- Create TryPostServer MCP server with 17 tools: Post (List, Get, Create, Delete), Hashtag (List, Create, Update, Delete), Label (List, Create, Update, Delete), Workspace (Get), ApiKey (List, Create, Delete) - Create AuthenticateMcpToken middleware (logs in workspace owner) - Register mcp.auth middleware alias in bootstrap/app.php - Create routes/ai.php with mcp.trypost.test subdomain - Add PostApiTest with 6 tests (list, show, create, delete, isolation) - Fix PostApiTest assertions for pagination/resource wrapping - 704 tests passing, frontend build passing
56 lines
1.2 KiB
Text
56 lines
1.2 KiB
Text
<?php
|
|
|
|
namespace {{ namespace }};
|
|
|
|
use Illuminate\Contracts\JsonSchema\JsonSchema;
|
|
use Laravel\Ai\Contracts\Agent;
|
|
use Laravel\Ai\Contracts\Conversational;
|
|
use Laravel\Ai\Contracts\HasStructuredOutput;
|
|
use Laravel\Ai\Contracts\HasTools;
|
|
use Laravel\Ai\Contracts\Tool;
|
|
use Laravel\Ai\Messages\Message;
|
|
use Laravel\Ai\Promptable;
|
|
use Stringable;
|
|
|
|
class {{ class }} implements Agent, Conversational, HasStructuredOutput, HasTools
|
|
{
|
|
use Promptable;
|
|
|
|
/**
|
|
* Get the instructions that the agent should follow.
|
|
*/
|
|
public function instructions(): Stringable|string
|
|
{
|
|
return 'You are a helpful assistant.';
|
|
}
|
|
|
|
/**
|
|
* Get the list of messages comprising the conversation so far.
|
|
*
|
|
* @return Message[]
|
|
*/
|
|
public function messages(): iterable
|
|
{
|
|
return [];
|
|
}
|
|
|
|
/**
|
|
* Get the tools available to the agent.
|
|
*
|
|
* @return Tool[]
|
|
*/
|
|
public function tools(): iterable
|
|
{
|
|
return [];
|
|
}
|
|
|
|
/**
|
|
* Get the agent's structured output schema definition.
|
|
*/
|
|
public function schema(JsonSchema $schema): array
|
|
{
|
|
return [
|
|
'value' => $schema->string()->required(),
|
|
];
|
|
}
|
|
}
|