Skip to main content
Glama

CTX: Context as Code (CaC) tool

by context-hub
MIT License
235
  • Apple
  • Linux
VariableResolver.php908 B
<?php declare(strict_types=1); namespace Butschster\ContextGenerator\Lib\Variable; /** * Main service for resolving variables in strings */ final readonly class VariableResolver { public function __construct( private VariableReplacementProcessorInterface $processor = new CompositeProcessor(), ) {} public function with(VariableReplacementProcessorInterface $processor): self { return new self(new CompositeProcessor([ $this->processor, $processor, ])); } /** * Resolve variables in the given text */ public function resolve(string|array|null $strings): string|array|null { if ($strings === null) { return null; } if (\is_array($strings)) { return \array_map($this->resolve(...), $strings); } return $this->processor->process($strings); } }

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