MCP Tools

list_generators

Lists the code generators that can export requests as code.

Overview

Call list_generators to find the generatorId that generate_code needs. The list holds Relay's built-in generators and any you've created, in the order Relay's Preview panel shows them.

Each generator has a kind. HTTP generators export HTTP requests, and WebSocket generators export WebSocket requests. A request can use only generators of its own kind.

{
  "kind": "websocket"
}

Parameters

Prop

Type

Return Value

An object with a generators array.

{
  "generators": [
    {
      "id": "raw",
      "name": "Raw",
      "kind": "http",
      "group": "",
      "language": "http",
      "fileExtension": "http",
      "isBuiltIn": true
    },
    {
      "id": "curl",
      "name": "cURL",
      "kind": "http",
      "group": "Shell",
      "language": "shell",
      "fileExtension": "sh",
      "isBuiltIn": true
    },
    {
      "id": "python-requests",
      "name": "Requests",
      "kind": "http",
      "group": "Python",
      "language": "python",
      "fileExtension": "py",
      "isBuiltIn": true
    }
  ]
}

Prop

Type

Discussion

A generator you create with the same id as a built-in one replaces it, so the list has one entry per id.

The tool returns an error when kind isn't http or websocket.

See Also