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);
      }
    });
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool creates or updates a proto, implying mutation, but doesn't cover permissions, side effects, error handling, or response format. This is inadequate for a mutation tool with zero annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero waste. It's front-loaded with the core operation and appropriately sized for the tool's complexity, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given this is a mutation tool with no annotations, no output schema, and moderate schema coverage, the description is incomplete. It lacks behavioral context, parameter explanations, and usage guidelines, failing to provide enough information for safe and effective tool invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 50%, with 'id' and 'proto' parameters. The description doesn't add any parameter details beyond what the schema provides (e.g., it doesn't explain 'proto' structure or 'id' usage). Since schema coverage is moderate, the baseline score of 3 applies, as the description doesn't compensate for the coverage gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('create or update') and resource ('proto'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'create_route' or 'update_service' that might handle similar operations on different resources, so it's not fully specific.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, exclusions, or compare to siblings like 'create_route' or 'update_service', leaving the agent with no usage context beyond the basic operation.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

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