Skip to main content
Glama
formatter.test.ts1.23 kB
import { Prompt } from "../definitions.js"; import { toMCPPrompt, toMCPPromptMessage } from "../formatter.js"; describe("formatter", () => { describe("toMCPPrompt", () => { it("should correctly transform a prompt to MCP Prompt", () => { // Arrange const input: Prompt = { name: "Test Prompt", description: "A test prompt description", instruction: "Some instruction", // including this even though it's not used in transformation }; // Act const result = toMCPPrompt(input); // Assert expect(result).toEqual({ name: "Test Prompt", description: "A test prompt description", }); }); }); describe("toMCPPromptMessage", () => { it("should correctly transform a prompt to MCP PromptMessage", () => { // Arrange const input: Prompt = { name: "Test Prompt", description: "A test prompt description", instruction: "Some instruction", }; // Act const result = toMCPPromptMessage(input); // Assert expect(result).toEqual({ role: "user", content: { type: "text", text: "Some instruction", }, }); }); }); });

Latest Blog Posts

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/cremich/promptz-mcp'

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