Skip to main content
Glama

Model Context Protocol Server

by hyen43
BasePrompt.js913 B
import { z } from "zod"; export class MCPPrompt { get promptDefinition() { return { name: this.name, description: this.description, arguments: Object.entries(this.schema).map(([name, schema]) => ({ name, description: schema.description, required: schema.required ?? false, })), }; } async getMessages(args = {}) { const zodSchema = z.object(Object.fromEntries(Object.entries(this.schema).map(([key, schema]) => [key, schema.type]))); const validatedArgs = (await zodSchema.parse(args)); return this.generateMessages(validatedArgs); } async fetch(url, init) { const response = await fetch(url, init); if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`); } return response.json(); } }

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/hyen43/mcpServer'

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