Skip to main content
Glama

@arizeai/phoenix-mcp

Official
by Arize-ai
usePrettyText.ts516 B
import { useMemo } from "react"; type TextType = "string" | "json"; /** * A hook that takes in text, detects if it is a JSON string, and formats it * @param text * @returns formatted text */ export function usePrettyText(text: string): { text: string; textType: TextType; } { return useMemo(() => { try { const parsed = JSON.parse(text); return { text: JSON.stringify(parsed, null, 2), textType: "json" }; } catch (e) { return { text, textType: "string" }; } }, [text]); }

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