delete_resource
Remove a specific resource by ID and type from the APISIX-MCP server, supporting routes, services, upstreams, and other configurations.
Instructions
Delete a resource by ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | resource id | |
| type | Yes | resource type |
Implementation Reference
- src/tools/common.ts:35-37 (handler)The inline handler function for the 'delete_resource' tool, which performs a DELETE request to the admin API for the specified resource type and ID.server.tool("delete_resource", "Delete a resource by ID", DeleteResourceSchema.shape, async (args) => { return await makeAdminAPIRequest(`/${args.type}/${args.id}`, "DELETE"); });
- src/schemas/common.ts:39-42 (schema)Zod schema for validating the input arguments of the 'delete_resource' tool, requiring 'id' (string) and 'type' (resource type enum).export const DeleteResourceSchema = z.object({ id: z.string().describe("resource id"), type: ResourceTypeSchema.describe("resource type"), });
- src/tools/common.ts:35-37 (registration)Registration of the 'delete_resource' tool on the MCP server, including description, input schema, and handler.server.tool("delete_resource", "Delete a resource by ID", DeleteResourceSchema.shape, async (args) => { return await makeAdminAPIRequest(`/${args.type}/${args.id}`, "DELETE"); });