Skip to main content
Glama

x402_create_protected_endpoint

Create an HTTP endpoint that requires x402 payment before returning data, with configurable path, method, price, and response payload.

Instructions

Create a new HTTP endpoint protected by x402 payment middleware. The endpoint will require payment before returning data.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "path": "<path>",
      "method": "<method>",
      "price": "<price>"
    },
    "name": "x402_create_protected_endpoint"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesThe endpoint path (e.g., '/weather', '/api/data')
priceYesPrice in USD format (e.g., '$0.10', '$1.50')
methodYesHTTP method for the endpoint
descriptionNoDescription of what the endpoint provides
inputSchemaNoJSON schema for input parameters
outputSchemaNoJSON schema for output response
responseDataNoThe data to return when payment is verified

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full burden. It does disclose one genuine behavioral trait, that the resulting endpoint requires payment before returning data, but it omits whether this is persistent registration, what happens on duplicate paths, whether auth/config is required first, and what the call returns. For a creation/mutation tool with zero annotation coverage, that is a substantial gap.

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

Conciseness4/5

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

Two short sentences, front-loaded with the action and artifact. The second sentence partly restates the first ("protected by x402 payment middleware" vs "will require payment") but does add the runtime consequence, so the slight redundancy is defensible.

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?

With seven parameters, three of them nested objects, and no output schema, the description should explain the inputSchema/outputSchema/responseData contract and what a successful call produces. It covers none of that, leaving the most complex parts of the tool undocumented anywhere.

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 100%, so all seven parameters, including the enum on method, are already documented in the schema, establishing the baseline of 3. The description adds no meaning about the nested inputSchema/outputSchema/responseData fields or the price string format beyond what the schema states.

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?

Names a specific verb+resource: "Create a new HTTP endpoint protected by x402 payment middleware." That is distinguishable from siblings like x402_list_protected_endpoints or x402_create_payment_request by naming the created artifact. It stops short of explicitly contrasting with those siblings, so it is clear but not fully differentiated.

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 says what the tool does but never when to choose it over x402_create_payment_request or the list/update variants. There are no stated prerequisites (e.g. that the express server or config must already exist) and no exclusions. The agent must infer the workflow position.

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