UNPKG

@mseep/apisix-mcp

Version:

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

15 lines (14 loc) 683 B
import { CreateOrUpdateStreamRouteSchema } from "../schemas/stream-route.js"; import makeAdminAPIRequest from "../utils/adminAPI.js"; const setupStreamRouteTools = (server) => { server.tool("create_or_update_stream_route", "Create a stream route, if the stream route already exists, it will be updated", CreateOrUpdateStreamRouteSchema.shape, async (args) => { const routeId = args.id; if (routeId) { return await makeAdminAPIRequest(`/stream_routes/${routeId}`, "PUT", args.route); } else { return await makeAdminAPIRequest(`/stream_routes`, "POST", args.route); } }); }; export default setupStreamRouteTools;