Skip to main content
Glama
policyRoutes.ts2 kB
import { Router } from 'express'; import { PolicyController } from '../controllers/PolicyController'; import { policyEngine } from '../index'; const router = Router(); const policyController = new PolicyController(policyEngine); /** * Get all policies * @route GET /policy * @group Policy - Policy management operations * @returns {object} 200 - Policy list * @returns {Error} 500 - Server error */ router.get('/', (req, res) => policyController.getPolicies(req, res)); /** * Get a policy by ID * @route GET /policy/{policyId} * @group Policy - Policy management operations * @param {string} policyId.path.required - Policy ID * @returns {Policy.model} 200 - Policy * @returns {Error} 404 - Policy not found * @returns {Error} 500 - Server error */ router.get('/:policyId', (req, res) => policyController.getPolicy(req, res)); /** * Create a new policy * @route POST /policy * @group Policy - Policy management operations * @param {Policy.model} policy.body.required - Policy object * @returns {Policy.model} 201 - Created policy * @returns {Error} 500 - Server error */ router.post('/', (req, res) => policyController.createPolicy(req, res)); /** * Update a policy * @route PUT /policy/{policyId} * @group Policy - Policy management operations * @param {string} policyId.path.required - Policy ID * @param {Policy.model} policy.body.required - Policy object * @returns {Policy.model} 200 - Updated policy * @returns {Error} 404 - Policy not found * @returns {Error} 500 - Server error */ router.put('/:policyId', (req, res) => policyController.updatePolicy(req, res)); /** * Delete a policy * @route DELETE /policy/{policyId} * @group Policy - Policy management operations * @param {string} policyId.path.required - Policy ID * @returns {object} 200 - Success message * @returns {Error} 404 - Policy not found * @returns {Error} 500 - Server error */ router.delete('/:policyId', (req, res) => policyController.deletePolicy(req, res)); export default router;

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/Nom-nom-hub/fullstack-mcp'

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