get_plugin_schema
Retrieve schema details for all plugins or a specific plugin by name in APISIX-MCP, enabling precise configuration and integration with supported plugin types.
Instructions
Get all plugins schema or a specific plugin schema by name
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | plugins name | |
| type | No | plugins type |
Implementation Reference
- src/tools/plugin.ts:21-31 (handler)The asynchronous handler function that implements the core logic of the 'get_plugin_schema' tool. It constructs a query based on optional 'type' parameter and fetches either a specific plugin schema by name or all schemas filtered by type via the admin API.async (args) => { let query = ""; if (args.type) { query = `?type=${args.type}`; } if (args.name) { return await makeAdminAPIRequest(`/plugins/${args.name}`); } else { return await makeAdminAPIRequest(`/plugins${query}`); } }
- src/schemas/plugin.ts:10-13 (schema)Zod input schema definition for the 'get_plugin_schema' tool, defining optional 'name' (string) and 'type' (enum: 'http' or 'stream') parameters.export const GetPluginSchemaSchema = z.object({ name: z.string().describe("plugins name"), type: z.enum(["http", "stream"]).optional().describe("plugins type"), });
- src/tools/plugin.ts:17-32 (registration)The server.tool() call that registers the 'get_plugin_schema' tool with the MCP server, including name, description, input schema, and inline handler function.server.tool( "get_plugin_schema", "Get all plugins schema or a specific plugin schema by name", GetPluginSchemaSchema.shape, async (args) => { let query = ""; if (args.type) { query = `?type=${args.type}`; } if (args.name) { return await makeAdminAPIRequest(`/plugins/${args.name}`); } else { return await makeAdminAPIRequest(`/plugins${query}`); } } );
- src/index.ts:30-30 (registration)Invocation of setupPluginTools which registers the 'get_plugin_schema' tool (among others) with the main MCP server instance.setupPluginTools(server);