Skip to main content
Glama

validate_webhook_handler

Check webhook handler design for PayRetailers compliance: catches ack-after-processing timeouts, 500 on business errors, missing eventId dedup, and signature flaws. Returns actionable errors, warnings, and info.

Instructions

REQUIRED whenever the user is designing, describing, or about to code a webhook receiver for PayRetailers — even if the design looks fine. Analyses a declarative description of the handler (URL, processing mode, ack strategy, idempotency, signature verification, replay protection, error mapping, ordering assumptions) against the PayRetailers contract and returns {errors, warnings, info} with actionable codes. Catches the top failure modes: acknowledging AFTER processing (times out and gets retried), returning 500 on business errors (infinite retries), missing eventId de-duplication (double-fulfilment), assuming wall-clock order (state corruption), HTTPS missing, signature disabled in production, replay window absent. Pair with get_webhook_playbook when designing from scratch.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesThe public URL that will receive PayRetailers webhook POSTs.
orderingNoWhether the handler relies on wall-clock order of events for the same entityId. Real deliveries can arrive out-of-order; a handler that assumes order will corrupt state.
ackStrategyYesWhen the handler returns 200: 'before-processing' (recommended), 'after-processing' (blocks retries but risks timeouts), 'conditional-on-outcome' (dangerous: business errors trigger retries).
environmentNoDeployment target for this handler. Defaults to 'sandbox'.
ipAllowlistNoOptional IP allowlist. NOT sufficient by itself — always combine with signature verification.
errorHandlingNoHow the handler maps internal exceptions to HTTP status. Business errors ('order not found') should NOT return 500 — that triggers infinite retries.
processingModeYesHow the handler processes the event: 'sync-in-request' = all business logic runs before returning 200; 'async-queue' = enqueue and return 200 immediately (recommended); 'async-thread' = fire-and-forget in-process background thread.
languageOrStackNoOptional stack hint (e.g. 'C# ASP.NET 8', 'Node.js Express', 'Python FastAPI'). Only used to sharpen suggestions.
replayProtectionNoOptional replay protection based on eventDate. Recommended: enabled=true with maxAgeMinutes=5.
idempotencyStrategyYesHow duplicate deliveries are de-duplicated. 'by-eventId' is the required strategy.
signatureVerificationYesHow the handler treats the PayRetailers webhook signature. 'strict' = reject on mismatch (recommended); 'log-only' = log and continue; 'disabled' = no verification (only acceptable for sandbox).
idempotencyStoreTtlDaysNoHow long processed eventIds are retained. Recommended >= 30 days to survive replay attempts and backlogs.
responseTargetLatencyMsNoExpected p95 latency of your endpoint in milliseconds. PayRetailers targets < 3000 ms for the 200 ack.
Behavior4/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 clearly states the return structure ({errors, warnings, info} with actionable codes) and the specific failure modes it catches (acknowledging after processing, returning 500 on business errors, missing idempotency, etc.), giving an agent a concrete mental model of what the tool will do. It does not go into output detail beyond that, but for a static-analysis/validation tool this is adequate; a 4 is warranted because it is explicit and actionable without being exhaustive.

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?

The description is longer than typical but every sentence earns its place: the usage directive is front-loaded, the evaluation scope is itemized, and the failure-mode list is concrete and useful. The only slight inefficiency is the duplication of some schema-derived concepts (like the retry risks), but overall it's tightly packed with high-signal guidance rather than filler.

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

Completeness4/5

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

Given the tool's complexity (13 parameters, 6 enums, nested objects, no output schema), the description is remarkably complete. It states the contract (payload fields), the output format, the key failure modes, and even mentions pairing with a related tool. It could include an example of the 'actionable codes', but the description's coverage of usage, scope, and behavior is sufficient for an agent to decide whether to call it and roughly what to provide.

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% — every parameter has a substantive description (e.g., ackStrategy explains the three options and warns about 'conditional-on-outcome', idempotencyStrategy says 'by-eventId' is required). The tool description itself adds only a few high-level hints (like the list of failure modes that map to parameters) but does not go beyond what the schema already explains. Since the schema does the heavy lifting, the baseline 3 is appropriate; the description reinforces but does not add new parameter-specific meaning.

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

Purpose5/5

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

The description names a specific verb ('Analyses') and a precise resource ('a declarative description of the handler... against the PayRetailers contract') and enumerates the exact inputs (URL, processing mode, ack strategy, etc.) and the output shape ({errors, warnings, info}). It also distinguishes itself from the sibling get_webhook_playbook by naming it explicitly, leaving no ambiguity about which tool fits a design-from-scratch task.

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

Usage Guidelines5/5

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

The opening word 'REQUIRED' plus the explicit trigger condition ('whenever the user is designing, describing, or about to code a webhook receiver') makes the when-to-use unmistakable. It also states an alternative ('Pair with get_webhook_playbook when designing from scratch') and even cautions that the tool is needed 'even if the design looks fine', closing off the common excuse of skipping validation.

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

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/payretailers-dev/payretailers-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server