update_variable
Modify environment variables in Codemagic CI/CD applications to configure build settings, update secrets, or adjust deployment parameters.
Instructions
Update an existing environment variable for a Codemagic application.
Args: app_id: The Codemagic application ID. variable_id: The variable ID to update. key: The variable name. value: The new variable value. group: The variable group name. secure: Whether the variable should be encrypted.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| app_id | Yes | ||
| variable_id | Yes | ||
| key | Yes | ||
| value | Yes | ||
| group | Yes | ||
| secure | No |
Implementation Reference
- codemagic_mcp/tools/variables.py:47-73 (handler)The tool handler definition for `update_variable` in the MCP server tools, which invokes the `CodemagicClient`.
async def update_variable( app_id: str, variable_id: str, key: str, value: str, group: str, secure: bool = False, ) -> Any: """Update an existing environment variable for a Codemagic application. Args: app_id: The Codemagic application ID. variable_id: The variable ID to update. key: The variable name. value: The new variable value. group: The variable group name. secure: Whether the variable should be encrypted. """ async with CodemagicClient() as client: return await client.update_variable( app_id=app_id, variable_id=variable_id, key=key, value=value, group=group, secure=secure, ) - codemagic_mcp/client.py:301-313 (handler)The underlying API client implementation for updating a variable, which performs the PUT request to the Codemagic API.
async def update_variable( self, app_id: str, variable_id: str, key: str, value: str, group: str, secure: bool = False, ) -> Any: return await self._put( f"/apps/{app_id}/variables/{variable_id}", json={"key": key, "value": value, "group": group, "secure": secure}, )