Skip to main content
Glama

@arizeai/phoenix-mcp

Official
by Arize-ai
getTemplateVariables.ts689 B
import { Template } from "../types/templating"; import Mustache from "mustache"; type GetTemplateVariableArgs = { template: Template; }; /** * Parse out the template variables of a prompt * @param {GetTemplateVariableArgs} args * @returns {string[]} a list of prompt template variables */ export function getTemplateVariables(args: GetTemplateVariableArgs): string[] { const { template } = args; const templateSpans = Mustache.parse(template); return templateSpans.reduce((acc, templateSpan) => { const [spanType, value] = templateSpan; if (spanType === "name" && typeof value === "string") { acc = [...acc, value]; } return acc; }, [] as string[]); }

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/Arize-ai/phoenix'

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