UNPKG

@mseep/apisix-mcp

Version:

[![smithery badge](https://smithery.ai/badge/@api7/apisix-mcp)](https://smithery.ai/server/@api7/apisix-mcp)

12 lines (11 loc) 663 B
import { CreateGlobalRuleSchema, UpdateGlobalRuleSchema } from "../schemas/plugin.js"; import makeAdminAPIRequest from "../utils/adminAPI.js"; const setupGlobalRuleTools = (server) => { server.tool("create_global_rule", "Create a global rule", CreateGlobalRuleSchema.shape, async (args) => { return await makeAdminAPIRequest(`/global_rules/${args.id}`, "PUT", args); }); server.tool("update_global_rule", "Update specific attributes of an existing global rule", UpdateGlobalRuleSchema.shape, async (args) => { return await makeAdminAPIRequest(`/global_rules/${args.id}`, "PATCH", args); }); }; export default setupGlobalRuleTools;