Skip to main content
Glama

CTX: Context as Code (CaC) tool

by context-hub
MIT License
235
  • Apple
  • Linux
ProjectStructurePromptAction.php1.52 kB
<?php declare(strict_types=1); namespace Butschster\ContextGenerator\McpServer\Action\Prompts; use Butschster\ContextGenerator\Application\Logger\LoggerPrefix; use Butschster\ContextGenerator\McpServer\Attribute\Prompt; use Butschster\ContextGenerator\McpServer\Routing\Attribute\Get; use PhpMcp\Schema\Content\PromptMessage; use PhpMcp\Schema\Content\TextContent; use PhpMcp\Schema\Enum\Role; use PhpMcp\Schema\Result\GetPromptResult; use Psr\Http\Message\ServerRequestInterface; use Psr\Log\LoggerInterface; #[Prompt( name: 'project-structure', description: 'Tries to guess the project structure', )] final readonly class ProjectStructurePromptAction { public function __construct( #[LoggerPrefix(prefix: 'prompts.project-structure')] private LoggerInterface $logger, ) {} #[Get(path: '/prompt/project-structure', name: 'prompts.project-structure')] public function __invoke(ServerRequestInterface $request): GetPromptResult { $this->logger->info('Getting project-structure prompt'); return new GetPromptResult( messages: [ new PromptMessage( role: Role::User, content: new TextContent( text: "Look at available contexts and try to find the project structure. If there is no context for structure. Request structure from context using JSON schema. Provide the result in JSON format", ), ), ], ); } }

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/context-hub/generator'

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