MCP Tools

get_generator

Returns a code generator's manifest and JavaScript source.

Overview

get_generator returns the source of a built-in generator or one you've created. Reading the built-in generator closest to the one you want is the quickest way to see how a generator uses the request and Relay's helpers.

{
  "id": "fetch"
}

Parameters

Prop

Type

Return Value

{
  "id": "fetch",
  "name": "Fetch API",
  "kind": "http",
  "group": "JavaScript",
  "language": "javascript",
  "fileExtension": "js",
  "isBuiltIn": true,
  "shadowsBuiltIn": false,
  "source": "var manifest = { id: 'fetch', name: 'Fetch API', group: 'JavaScript', … };\n\nfunction generate(req, r) {\n…"
}

Prop

Type

Discussion

The tool returns an error when no generator has the id you pass. The message lists the generators there are.

See Also