Method

config.set

Change one or more settings by path, validated against the schema, all or none; null restores a default.

Changes one or more Configuration settings by path, all or none, validated against config.schema. Give changes as an object of path to value; a null value restores the default. It changes red-ale's Configuration only, never a book, and works with no book open.

Settings that open the network or hold keys (quotes.network and the quote services' keys) cannot be changed through the MCP server, only through JSON-RPC or the CLI by a person, so an AI agent cannot switch the network on.

Examples

Example: with no book.

JSON-RPC

Request:

{"jsonrpc":"2.0","id":1,"method":"config.set","params":{"changes":{"quotes.network":true}}}

Response:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "values": {
      "quotes.network": true
    },
    "clearedKeys": [],
    "configFile": null
  }
}

Request:

{"jsonrpc":"2.0","id":2,"method":"config.set","params":{"changes":{"period.bogus":1}}}

Response:

{
  "jsonrpc": "2.0",
  "id": 2,
  "error": {
    "code": -32602,
    "message": "…",
    "data": {
      "problems": [
        {
          "path": "period.bogus",
          "message": "…"
        }
      ],
      "help": "error/invalid-params"
    }
  }
}

Command line

red-ale exec --script - <<'EOF'
config.set {"changes":{"quotes.network":true}}
config.set {"changes":{"period.bogus":1}}
EOF

It fails with exit status 2, printing on standard error:

{
  "error": {
    "code": -32602,
    "message": "…",
    "data": {
      "problems": [
        {
          "path": "period.bogus",
          "message": "…"
        }
      ],
      "help": "error/invalid-params"
    }
  }
}

MCP tool call

Tool call:

{"name":"config.set","arguments":{"changes":{"quotes.network":true}}}

Result:

{
  "structuredContent": {
    "values": {
      "quotes.network": true
    },
    "clearedKeys": [],
    "configFile": null
  }
}

Tool call:

{"name":"config.set","arguments":{"changes":{"period.bogus":1}}}

Result:

{
  "isError": true,
  "structuredContent": {
    "error": {
      "code": -32602,
      "name": "invalid-params",
      "message": "…",
      "data": {
        "problems": [
          {
            "path": "period.bogus",
            "message": "…"
          }
        ],
        "help": "error/invalid-params"
      }
    }
  }
}

Effect: write, on the Configuration only.

Params

Params of config.set.

  • changes (object, required): Setting paths to their new values; null restores a setting's default. No path may lie inside another.

Result

The result of config.set.

  • values (object, required): Each path changed, with its value now, as config.get shows it.
  • clearedKeys (array of string, required): Keys cleared because their Quote service's URL moved to another host.
  • configFile (string or null): The Configuration file; null for a process started with --no-config, whose Configuration is in memory.