Skip to main content
Glama

generate_line_draft

Generate a draft endpoint under a line from a sample inbound request and a description of the target: infers the inbound body schema from the sample, reads the target's method/URL/fields from an OpenAPI document (targetDocument) or a bare sample plus targetUrl, and proposes an outgoingMapping pairing every target field to a same-named inbound field. Nothing is guessed — a target field with no same-named match is reported in the "unmapped" list instead of being mapped, and every field it did map carries "inferred": true in the stored mapping tree. Always writes a draft (never publishes); the draft flows through preview_line_draft, dry_run_endpoint, config_diff and publish_line_draft like any other. Requires edit access.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sampleYesA sample inbound request body, shaped as one a real caller would send — one JSON field per key.
lineKeyYesThe line key to draft the generated endpoint under.
targetUrlNoThe target URL. Required when targetSample is used; ignored when targetDocument is used (its servers[] entry wins).
deliveryModeYesThe caller contract this endpoint offers: async acceptance with later outcomes, one sync reply, or a stream.
targetSampleNoA raw sample of the target's own request body, used instead of targetDocument when there is no spec to read. Requires targetUrl.
draftRevisionYesThe line's current draft revision (0 for a line with no draft yet) — see get_line_draft.
targetDocumentNoThe target's OpenAPI 3.x document (YAML or JSON). Mutually exclusive with targetSample; must describe exactly one operation.
targetFilenameNoFilename hint for targetDocument, to decide YAML vs JSON. Defaults to "target.json".
targetHttpMethodNoHTTP method for the target when using targetSample. Defaults to POST.

TDQS

A4.5/5.0
Behavior5/5

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

Annotations only declare readOnlyHint=false and destructiveHint=false; the description carries substantial behavioral weight beyond that. It discloses the non-guessing policy ('Nothing is guessed'), the unmapped list for unmatched target fields, the 'inferred': true flag on each mapped field in the stored mapping tree, the draft-never-publish guarantee, and the 'Requires edit access' permission. There is no contradiction with the annotations — a draft write is consistent with readOnlyHint=false.

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 core verb and resource are front-loaded in the first sentence, with supporting behavioral detail (non-guessing, unmapped list, draft-not-publish) following. It is a single dense paragraph of roughly 150 words, which is justified given 9 parameters, mutually exclusive modes and nested objects, but it could be tightened or structured slightly.

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 complexity — 9 parameters, nested objects (sample, targetSample), mutually exclusive input modes, an enum, and no output schema — the description covers the operational essentials well: both input paths, mapping semantics, the unmapped list, the inferred flag, the draft pipeline, and the access requirement. It does not spell out the exact return shape, but it describes the stored mapping tree and unmapped output, which fills most of what an output schema would convey.

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 coverage is 100% with every parameter described, so the baseline is 3. The description adds workflow-level meaning on top: it consolidates the two mutually exclusive input modes (targetDocument vs targetSample+targetUrl), references the servers[]-wins precedence over targetUrl, and ties targetFilename's YAML/JSON role to targetDocument. This relational gloss exceeds what the individual schema descriptions provide.

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+resource ('Generate a draft endpoint under a line') and describes a concrete mechanism: infer the inbound body schema from a sample, read the target's method/URL/fields from an OpenAPI document or bare sample + targetUrl, and propose a same-named outgoingMapping. It explicitly contrasts itself with filtering/publishing siblings by declaring it 'always writes a draft (never publishes)', with downstream flow through preview_line_draft, dry_run_endpoint, config_diff and publish_line_draft, so an agent can separate it from the similar-named draft/publish tool family.

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

Usage Guidelines4/5

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

Gives clear context on what inputs drive the tool (targetDocument XOR targetSample+targetUrl, deliveryMode, draftRevision) and states the exclusion 'never publishes', which routes agents to publish_line_draft for the publish step. It names the downstream pipeline tools. It does not explicitly spell out when this should be used instead of create_endpoint, but the draft-vs-live distinction is strongly implied.

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.

TDQS

A3.6/5.0
Disambiguation3/5

Most tools target distinct resources and the descriptions are unusually explicit, but the billing cluster (change_plan/cancel_subscription and the many add-on actions) plus the preview/diff tools overlap and could cause mis-selection. config_diff, dry_run_endpoint, and preview_line_draft all read as 'preview what will change' at first glance despite different scopes.

Naming Consistency4/5

The overwhelming majority follow a clean snake_case verb_noun pattern: create_*, get_*, list_*, set_*, update_*, delete_*. It is only held back by a few naming outliers such as config_diff and default_endpoint_template, which break the verb-first convention.

Tool Count1/5

78 tools is an extreme mismatch for an MCP server surface, even accounting for the broad management/relay domain. Such a large surface will overwhelm model context and make tool selection materially harder; this would be better split into focused servers for configuration, data-plane operations, and billing.

Completeness4/5

The tool surface is very thorough: projects, lines, endpoints, credentials, keys, configs/drafts, DLQ, requests, metrics, audit, team, and billing are all represented. Only minor gaps exist, such as no direct single-line get/update and the intentional inability to widen the outbound allowlist or lift archive protection via API.

Resources