variable_set
Set or update environment variables for services on railway-mcp, ideal for configuring values, managing secrets, and updating connection strings. Use for individual variable changes.
Instructions
[API] Create or update an environment variable
⚡️ Best for: ✓ Setting configuration values ✓ Updating connection strings ✓ Managing service secrets
⚠️ Not for: × Bulk variable updates (use variable_bulk_set) × Temporary configuration changes
→ Prerequisites: service_list
→ Alternatives: variable_bulk_set
→ Next steps: deployment_trigger, service_restart
→ Related: variable_list, variable_delete
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| environmentId | Yes | ID of the environment for the variable (usually obtained from service_list) | |
| name | Yes | Name of the environment variable | |
| projectId | Yes | ID of the project containing the service | |
| serviceId | No | Optional: ID of the service for the variable, if omitted creates/updates a shared variable | |
| value | Yes | Value to set for the variable |