delete_cache
Delete a specific build cache for a Codemagic application to free storage and force a fresh build.
Instructions
Delete a specific build cache for a Codemagic application.
Args: app_id: The Codemagic application ID. cache_id: The cache ID to delete.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| app_id | Yes | ||
| cache_id | Yes |
Implementation Reference
- codemagic_mcp/tools/caches.py:30-39 (handler)The MCP tool handler that registers 'delete_cache' with a destructive hint, taking app_id and cache_id, and delegating to the client.
@mcp.tool(annotations=ToolAnnotations(destructiveHint=True)) async def delete_cache(app_id: str, cache_id: str) -> Any: """Delete a specific build cache for a Codemagic application. Args: app_id: The Codemagic application ID. cache_id: The cache ID to delete. """ async with CodemagicClient() as client: return await client.delete_cache(app_id, cache_id) - codemagic_mcp/client.py:481-482 (helper)The CodemagicClient helper method that sends the HTTP DELETE request to the API endpoint /apps/{app_id}/caches/{cache_id}.
async def delete_cache(self, app_id: str, cache_id: str) -> Any: return await self._delete(f"/apps/{app_id}/caches/{cache_id}") - codemagic_mcp/tools/__init__.py:6-12 (registration)Registration: register_all_tools calls caches.register(mcp), which registers delete_cache as an MCP tool.
def register_all_tools(mcp: FastMCP) -> None: apps.register(mcp) builds.register(mcp) artifacts.register(mcp) caches.register(mcp) variables.register(mcp) webhooks.register(mcp) - codemagic_mcp/tools/caches.py:30-40 (schema)The schema is defined implicitly by the function signature: app_id: str, cache_id: str, returning Any. A destructiveHint annotation is also applied.
@mcp.tool(annotations=ToolAnnotations(destructiveHint=True)) async def delete_cache(app_id: str, cache_id: str) -> Any: """Delete a specific build cache for a Codemagic application. Args: app_id: The Codemagic application ID. cache_id: The cache ID to delete. """ async with CodemagicClient() as client: return await client.delete_cache(app_id, cache_id)