Skip to main content
Glama
policy.ts•791 B
import type { ServerConfig } from './types.js'; export class Policy { #cfg: ServerConfig; constructor(cfg: ServerConfig){ this.#cfg = cfg; } allowGuild(guildId: string){ const list = this.#cfg.allow.guildIds; return !list || list.length===0 || list.includes(guildId); } allowChannel(channelId: string){ const list = this.#cfg.allow.channelIds; return !list || list.length===0 || list.includes(channelId); } allowedMentions(){ const p = this.#cfg.defaultAllowedMentions; switch(p){ case 'users': return { parse: ['users'] as const }; case 'roles': return { parse: ['roles'] as const }; case 'everyone': return { parse: ['everyone'] as const }; case 'none': default: return { parse: [] as const }; } } }

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/GustyCube/discord-mcp'

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