Skip to main content
Glama
plan-enforcer.js556 B
import { loadPlan } from "./plan-registry.js"; function pathMatchesScope(filePath, scopePattern) { if (scopePattern.endsWith("/**")) { const base = scopePattern.replace("/**", ""); return filePath.startsWith(base); } return filePath === scopePattern; } export function enforcePlan(planId, filePath) { const plan = loadPlan(planId); for (const scope of plan.scope) { if (pathMatchesScope(filePath, scope)) { return; } } throw new Error( `PLAN_SCOPE_VIOLATION: ${filePath} not permitted by plan ${planId}` ); }

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/dylanmarriner/MCP-server'

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