Skip to main content
Glama

Preview dynamic endpoint

preview_dynamic_endpoint
Destructive

Render what a dynamic endpoint serves WITHOUT publishing — runs the endpoint's workflow through the full serve path (input + bound datafile + content-type) and returns the response, so you can preview a DRAFT before publishing (or verify any version). Omit version to preview the latest draft; pass a version to preview that one. For a :param endpoint (e.g. 'post/:slug'), pass sample params (e.g. {"slug":"hello"}) — they run through the definition's input_transform, so you can preview a specific URL and confirm a good value renders and a bad one fails input validation. To preview a specific request, also pass its query string, method, body (+ content_type), headers and cookies: they are read exactly as serving reads a live request (only declared names reach the transform; what serving refuses fails the preview with serving's reason). On a verify endpoint (webhook or Turnstile) nothing is checked: it runs as though the provider accepted the request, and message says so. This executes the workflow (may have side effects). Returns content_type, output (decoded as a string), the run status (status=failed with a message when the render did not succeed), the run_id (drill into the full run/traces with get_workflow_run_traces), and resolved_input (the $input the transform produced, for debugging the mapping).

Input Schema

NameRequiredDescriptionDefault
bodyNothe sample request body, for a method that carries one: a JSON value (sent as application/json), or a string sent as-is, such as a form ("name=Ada&email=ada%40example.com" with content_type application/x-www-form-urlencoded). Parsed as serving parses a live body; the transform reads it as body
slugNothe endpoint slug (provide this or endpoint_id)
queryNoa sample query string, exactly what follows '?' in the URL (e.g. "q=lamps&tag=a&tag=b"). Only the names the endpoint declares in its query list reach the input_transform as query.<name> (a repeated name becomes an array); on a strict_query endpoint an undeclared name fails the preview with serving's 400
methodNothe sample request's HTTP method (GET, POST, PUT, PATCH, DELETE); default GET. Must be one the endpoint lists, else the preview fails as serving would answer 405. The transform reads it as request.method
paramsNosample path parameters for a :param endpoint (e.g. {"slug":"hello"} for a 'post/:slug' endpoint); fed to the definition's input_transform to build $input, so you can preview a specific URL and confirm it passes the workflow's input_schema
cookiesNosample cookies by name. Only the ones the endpoint declares in cookies reach request.cookies; others, and protected names (__Host-, __Secure-, __cf, _cf, cf_), are dropped
headersNosample request headers by name. Only the ones the endpoint declares in headers reach request.headers (and, on a verify webhook, the provider's delivery headers); others are dropped
versionNospecific version to preview; omit (0) for the latest version (the draft)
endpoint_idNothe endpoint id (provide this or slug)
content_typeNothe sample body's Content-Type: application/json (the default) or application/x-www-form-urlencoded
viewer_emailNosimulated viewer's email, bound as auth.email. Only takes effect when the endpoint has a role allowlist (auth.allow.tenant_roles) — that is the only case where a real address reaches a workflow, so a preview without one ignores this, exactly as serving would
viewer_rolesNosimulated viewer's roles in this workspace, bound as auth.roles (e.g. ["ROLE_ADMIN"]) so you can preview role-gated rendering. Like viewer_email, only takes effect on an endpoint with a role allowlist
viewer_user_idNosimulate a signed-in viewer for previewing a gated endpoint that exposes identity: the derived auth.viewer_id is computed from this, so the preview shows the real identifier. Omit it and a visible placeholder stands in. Ignored unless the endpoint gates and exposes identity

Output Schema

NameRequiredDescriptionDefault
outputYes
run_idNo
statusYes
messageNo
content_typeYes
resolved_inputNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changed
    • addedInput schema / properties / body
      Added value: +{
      +  "description": "the sample request body, for a method that carries one: a JSON value (sent as application/json), or a string sent as-is, such as a form (\"name=Ada&email=ada%40example.com\" with content_type application/x-www-form-urlencoded). Parsed as serving parses a live body; the transform reads it as body"
      +}
    • addedInput schema / properties / content_type
      Added value: +{
      +  "description": "the sample body's Content-Type: application/json (the default) or application/x-www-form-urlencoded",
      +  "type": "string"
      +}
    • addedInput schema / properties / cookies
      Added value: +{
      +  "additionalProperties": {
      +    "type": "string"
      +  },
      +  "description": "sample cookies by name. Only the ones the endpoint declares in cookies reach request.cookies; others, and protected names (__Host-, __Secure-, __cf, _cf, cf_), are dropped",
      +  "type": "object"
      +}
    • addedInput schema / properties / headers
      Added value: +{
      +  "additionalProperties": {
      +    "type": "string"
      +  },
      +  "description": "sample request headers by name. Only the ones the endpoint declares in headers reach request.headers (and, on a verify webhook, the provider's delivery headers); others are dropped",
      +  "type": "object"
      +}
    • addedInput schema / properties / method
      Added value: +{
      +  "description": "the sample request's HTTP method (GET, POST, PUT, PATCH, DELETE); default GET. Must be one the endpoint lists, else the preview fails as serving would answer 405. The transform reads it as request.method",
      +  "type": "string"
      +}
    • addedInput schema / properties / query
      Added value: +{
      +  "description": "a sample query string, exactly what follows '?' in the URL (e.g. \"q=lamps&tag=a&tag=b\"). Only the names the endpoint declares in its query list reach the input_transform as query.<name> (a repeated name becomes an array); on a strict_query endpoint an undeclared name fails the preview with serving's 400",
      +  "type": "string"
      +}
  2. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations declare destructiveHint=true, readOnlyHint=false, openWorldHint=true, idempotentHint=false, and the description corroborates with the critical warning 'This executes the workflow (may have side effects)' rather than contradicting it. It adds behavior the annotations cannot express: verify endpoints skip provider checks and say so in `message`, undeclared names are dropped before the transform, strict_query returns serving's 400 and a wrong method returns a 405. It also names the return payload (content_type, output, status, run_id, resolved_input).

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?

Front-loaded with the core action and the no-publish constraint, then built as a sequence of conditional cases, so an agent can scan to the branch it needs. It is a single dense paragraph with some run-on stretches (the params/query/body clause is heavy), so it is efficient but not maximally crisp.

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

Completeness5/5

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

For a 13-parameter, side-effecting tool with nested objects and an output schema, the description covers the risky edge cases an agent must know before calling: draft vs version selection, path-param enumeration, simulated request surface, role-gating behavior on viewer_*, and the verify-endpoint shortcut. It even points to the sibling (get_workflow_run_traces) for drilling into run_id, so nothing critical is left open.

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

Parameters4/5

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

Schema description coverage is 100%, so the baseline is 3, but the description earns above it by explaining parameter interaction: version=0/omitted means the draft, `params` are fed to input_transform to build $input, and the viewer_* trio is silently ignored unless the endpoint has a role allowlist. It synthesizes the parameters into scenarios rather than restating each field, though some of this overlaps the already rich schema descriptions.

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?

States a specific verb and resource — render what a dynamic endpoint serves without publishing — and names the mechanism (runs the workflow through the full serve path). The publish-vs-preview contrast immediately distinguishes it from publish_dynamic_endpoint and get_dynamic_endpoint, which only return the stored definition.

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?

Explicitly tells the agent when to use this (preview a draft before publishing, or verify any published version) and gives selection rules for the ambiguous cases: omit version for the latest draft, pass a version for a specific one, pass `params` for a :param endpoint, pass query/method/body/headers/cookies to simulate a specific request. That is when-to-use guidance with conditional routing, not inference.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources