MCP Tools

list_variables

Lists variables by scope, with secret values hidden.

Overview

list_variables shows the variables {{tokens}} resolve from. With requestId, it returns the scopes that request uses, highest precedence first: its folders (innermost first), the active environment, its collection, the workspace, then globals. It also returns used, every variable the request refers to, and missing, those that resolve to nothing. Without requestId, it returns every scope in the workspace: each environment, the workspace's own variables, the collections and folders that have any, and globals.

A secret variable's value is never shown. Values that look like credentials, by their name or because they match a secret, appear as [redacted] too.

{
  "requestId": "5B2C8E41-9D3A-4F67-B0E8-1A4C7D2F6E95"
}

Parameters

Prop

Type

Return Value

An object with scopes, and with requestId, used and missing.

{
  "scopes": [
    {
      "scope": "environment",
      "id": "C3A9F0E2-1B7D-4E8A-8F21-6D5C0B9A7E13",
      "name": "Staging",
      "isActive": true,
      "variables": [
        { "key": "baseUrl", "value": "https://staging.example.com" },
        { "key": "token", "value": "[redacted]", "secret": true }
      ]
    }
  ],
  "used": ["baseUrl", "token"],
  "missing": []
}

Each scope has scope (folder, environment, collection, workspace or global), its id and name (except globals), and variables. An environment also has isActive. A variable has key and value, and secret, enabled, description and missing when they apply; missing is true for a secret with no value on this Mac.

See Also

  • set_variables: Adds, changes or removes variables in one scope.
  • get_auth: Reads the auth a request, folder, collection or workspace sets.
  • list_requests: Lists the requests and drafts in Relay, with the workspaces that hold them.