create_or_update_plugin_metadata
Manage plugin configurations by creating or updating metadata in the APISIX-MCP server, enabling control over plugin functionality and behavior.
Instructions
Create or update plugin metadata
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| metadata | Yes | plugins configuration | |
| name | Yes | plugins name |
Implementation Reference
- src/tools/plugin.ts:46-53 (registration)Registration of the create_or_update_plugin_metadata tool on the MCP server, including tool name, description, input schema reference, and inline handler function that sends a PUT request to the admin API with plugin name and metadata.server.tool( "create_or_update_plugin_metadata", "Create or update plugin metadata", CreateOrUpdatePluginMetadataSchema.shape, async (args) => { return await makeAdminAPIRequest(`/plugin_metadata/${args.name}`, "PUT", args.metadata); } );
- src/schemas/plugin.ts:19-22 (schema)Zod schema defining the input for the tool: plugin name and metadata object.export const CreateOrUpdatePluginMetadataSchema = z.object({ name: z.string().describe("plugins name"), metadata: PluginSchema, });
- src/schemas/plugin.ts:4-8 (schema)Supporting schema for plugin metadata configuration, used within CreateOrUpdatePluginMetadataSchema.export const PluginSchema = z.object({ _meta: z.object({ disable: z.boolean().default(false).describe("control whether the plugin is enabled"), }).optional(), }).passthrough().describe("plugins configuration");
- src/tools/plugin.ts:50-52 (handler)Inline handler function executing the tool logic by making an admin API PUT request.async (args) => { return await makeAdminAPIRequest(`/plugin_metadata/${args.name}`, "PUT", args.metadata); }