Skip to main content
Glama

Generate payload schema

generate_payload_schema
Read-onlyIdempotent

Generate TypeScript interfaces, Zod schemas, Pydantic models, or JSON Schema from webhook request bodies captured by a sandbox endpoint, inferring optional and nullable fields across requests.

Instructions

Generate TypeScript interfaces, Zod schemas, Pydantic models, or JSON Schema from the bodies of requests captured by a sandbox endpoint. Several requests of one event teach which fields are optional or nullable.

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": {
      "endpointSlug": "<endpointSlug>"
    },
    "name": "generate_payload_schema"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameNoRoot type name (default: from the detected event, else WebhookPayload)
pathNoOnly requests with this path
eventNoOnly requests whose detected provider event matches, e.g. "invoice.paid" or "push". One event per schema gives the tightest types.
limitNoHow many of the latest requests to read before filtering
formatNoOutput: "typescript" interfaces, "zod" schemas, "pydantic" models, or "json-schema"typescript
methodNoOnly requests with this HTTP method
requestIdsNoUse exactly these requests instead of the latest ones
endpointSlugYesThe endpoint slug

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.20.4
    • removedInput schema / $schema
      Removed value: -"https://json-schema.org/draft/2020-12/schema"
  2. Changed1 schema field changedv1.19.0
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  3. Addedv1.5.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive, and closed-world, so safety needs no restating. The description still adds real behavioral context: output quality depends on sample breadth, with multiple requests of one event being needed to infer optional and nullable fields. It does not cover failure modes such as an endpoint with zero captured requests.

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?

Two sentences, front-loaded with the output formats and source data, followed by the one non-obvious usage tip. No filler or redundant restatement of the title.

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?

With no output schema, the description usefully states what is produced (four named artifact kinds) and where the input comes from, which is what an agent needs. Minor gaps remain around outcomes for empty or sparse request sets, but the tool is adequately covered for an 8-parameter, one-required-parameter operation.

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 coverage is 100%, so every parameter including the format enum is already documented in the schema, which sets the baseline at 3. The description adds only marginal semantics, chiefly the link between sampling one event and tighter generated types, which the event parameter's own description already conveys.

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 ('Generate') and an enumerated set of artifacts ('TypeScript interfaces, Zod schemas, Pydantic models, or JSON Schema') plus the exact source ('bodies of requests captured by a sandbox endpoint'). This clearly separates it from siblings like list_requests or get_request, which read requests rather than synthesize a schema.

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

Usage Guidelines3/5

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

It gives a how-to hint ('Several requests of one event teach which fields are optional or nullable') that effectively recommends grouping samples by event, but never states prerequisites (an endpoint must exist and have captured requests) or when to prefer this over get_request/list_requests. Usage is implied rather than prescribed.

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