Skip to main content
Glama

variable_bulk_set

Create or update multiple environment variables simultaneously for Railway.app services, enabling bulk configuration management during migrations, initial setups, or updates.

Instructions

[WORKFLOW] Create or update multiple environment variables at once

⚡️ Best for: ✓ Migrating configuration between services ✓ Initial service setup ✓ Bulk configuration updates

⚠️ Not for: × Single variable updates (use variable_set) × Temporary configuration changes

→ Prerequisites: service_list

→ Alternatives: variable_set

→ Next steps: deployment_trigger, service_restart

→ Related: variable_list, service_update

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesID of the project containing the service
environmentIdYesID of the environment for the variables (usually obtained from service_list)
variablesYesObject mapping variable names to values
serviceIdNoOptional: ID of the service for the variables, if omitted updates shared variables)

Implementation Reference

  • Core implementation of the bulk variable set logic: transforms variables object into array of upsert inputs and calls the API client.
    async bulkUpsertVariables(projectId: string, environmentId: string, variables: Record<string, string>, serviceId?: string) { try { const inputs = Object.entries(variables).map(([name, value]) => ({ projectId, environmentId, name, value, serviceId })); await this.client.variables.upsertVariables(inputs); const variableType = serviceId ? "service variables" : "shared environment variables"; return createSuccessResponse({ text: `Successfully updated ${inputs.length} ${variableType}` }); } catch (error) { return createErrorResponse(`Error updating variables: ${formatError(error)}`); } }
  • Zod input schema defining parameters for the variable_bulk_set tool.
    { projectId: z.string().describe("ID of the project containing the service"), environmentId: z.string().describe("ID of the environment for the variables (usually obtained from service_list)"), variables: z.record(z.string()).describe("Object mapping variable names to values"), serviceId: z.string().optional().describe("Optional: ID of the service for the variables, if omitted updates shared variables)") },
  • Tool registration using createTool, including name, formatted description, schema, and handler function.
    "variable_bulk_set", formatToolDescription({ type: 'WORKFLOW', description: "Create or update multiple environment variables at once", bestFor: [ "Migrating configuration between services", "Initial service setup", "Bulk configuration updates" ], notFor: [ "Single variable updates (use variable_set)", "Temporary configuration changes" ], relations: { prerequisites: ["service_list"], nextSteps: ["deployment_trigger", "service_restart"], alternatives: ["variable_set"], related: ["variable_list", "service_update"] } }), { projectId: z.string().describe("ID of the project containing the service"), environmentId: z.string().describe("ID of the environment for the variables (usually obtained from service_list)"), variables: z.record(z.string()).describe("Object mapping variable names to values"), serviceId: z.string().optional().describe("Optional: ID of the service for the variables, if omitted updates shared variables)") }, async ({ projectId, environmentId, variables, serviceId }) => { return variableService.bulkUpsertVariables(projectId, environmentId, variables, serviceId); } ),
  • Registers all tools, including variableTools containing variable_bulk_set, with the MCP server.
    export function registerAllTools(server: McpServer) { // Collect all tools const allTools = [ ...databaseTools, ...deploymentTools, ...domainTools, ...projectTools, ...serviceTools, ...tcpProxyTools, ...variableTools, ...configTools, ...volumeTools, ...templateTools, ] as Tool[]; // Register each tool with the server allTools.forEach((tool) => { server.tool( ...tool ); }); }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/epitaphe360/railway-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server