Skip to main content
Glama

update_route

Modifies attributes of an existing route in APISIX-MCP, including paths, methods, hosts, upstreams, and plugins, to optimize API gateway configurations.

Instructions

Update specific attributes of an existing route

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idNoroute id
routeNoroute configuration

Implementation Reference

  • The inline handler function for the 'update_route' tool, which makes a PATCH request to the Admin API endpoint `/routes/${args.id}` with the provided route updates. Note that this is embedded within the tool registration.
    server.tool("update_route", "Update specific attributes of an existing route", UpdateRouteSchema.shape, async (args) => { return await makeAdminAPIRequest(`/routes/${args.id}`, "PATCH", args.route); });
  • Zod schema defining the input for the 'update_route' tool: requires route ID and optional partial route configuration for patching.
    export const UpdateRouteSchema = createNullablePatchSchema(z.object({ id: z.string().describe("route id"), route: RouteSchema.partial(), }));
  • Registers the 'update_route' MCP tool with the server, including description, input schema, and handler.
    server.tool("update_route", "Update specific attributes of an existing route", UpdateRouteSchema.shape, async (args) => { return await makeAdminAPIRequest(`/routes/${args.id}`, "PATCH", args.route); });
  • src/index.ts:23-23 (registration)
    Top-level call to setupRouteTools, which registers the update_route tool among others.
    setupRouteTools(server);

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/api7/apisix-mcp'

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