Skip to main content
Glama

create_or_update_proto

Generate or modify protocol configurations (protos) on the APISIX-MCP server, ensuring up-to-date content for seamless integration with large language models (LLMs) and the APISIX Admin API.

Instructions

Create a proto, if the proto already exists, it will be updated

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idNoproto id
protoYes

Implementation Reference

  • Core handler logic for the 'create_or_update_proto' tool: determines if proto ID is provided and makes appropriate POST or PUT request to the admin API.
    const protoId = args.id; if (protoId) { return await makeAdminAPIRequest(`/protos/${protoId}`, "PUT", args.proto); } else { return await makeAdminAPIRequest("/protos", "POST", args.proto); }
  • Zod input schema defining the parameters for the create_or_update_proto tool: optional id and required proto object.
    export const CreateOrUpdateProtoSchema = z.object({ id: z.string().optional().describe("proto id"), proto: ProtoSchema, });
  • Registers the 'create_or_update_proto' tool on the MCP server with name, description, input schema, and inline handler function.
    server.tool("create_or_update_proto", "Create a proto, if the proto already exists, it will be updated", CreateOrUpdateProtoSchema.shape, async (args) => { const protoId = args.id; if (protoId) { return await makeAdminAPIRequest(`/protos/${protoId}`, "PUT", args.proto); } else { return await makeAdminAPIRequest("/protos", "POST", args.proto); } });

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