Skip to main content
Glama

add_variable

Add environment variables to Codemagic applications for configuration management, including secure variables for secrets and tokens.

Instructions

Add an environment variable to a Codemagic application.

Args: app_id: The Codemagic application ID. key: The variable name. value: The variable value. group: The variable group name. secure: Whether the variable should be encrypted (e.g. for secrets/tokens).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
app_idYes
keyYes
valueYes
groupYes
secureNo

Implementation Reference

  • The implementation of add_variable in the CodemagicClient class.
    async def add_variable(
        self,
        app_id: str,
        key: str,
        value: str,
        group: str,
        secure: bool = False,
    ) -> Any:
        return await self._post(
            f"/apps/{app_id}/variables",
            json={"key": key, "value": value, "group": group, "secure": secure},
        )
  • The MCP tool wrapper for add_variable, which calls the client method.
    @mcp.tool()
    async def add_variable(
        app_id: str,
        key: str,
        value: str,
        group: str,
        secure: bool = False,
    ) -> Any:
        """Add an environment variable to a Codemagic application.
    
        Args:
            app_id: The Codemagic application ID.
            key: The variable name.
            value: The variable value.
            group: The variable group name.
            secure: Whether the variable should be encrypted (e.g. for secrets/tokens).
        """
        async with CodemagicClient() as client:
            return await client.add_variable(
                app_id=app_id,
                key=key,
                value=value,
                group=group,
                secure=secure,
            )

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/AgiMaulana/CodemagicMcp'

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