Skip to main content
Glama

delete_all_caches

Destructive

Clear all build caches for a Codemagic app to free storage or force a fresh build.

Instructions

Delete all build caches for a Codemagic application.

Args: app_id: The Codemagic application ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
app_idYes

Implementation Reference

  • The tool handler function 'delete_all_caches' registered as an MCP tool with destructiveHint=True. It takes an app_id, creates a CodemagicClient, and calls client.delete_all_caches(app_id).
    @mcp.tool(annotations=ToolAnnotations(destructiveHint=True))
    async def delete_all_caches(app_id: str) -> Any:
        """Delete all build caches for a Codemagic application.
    
        Args:
            app_id: The Codemagic application ID.
        """
        async with CodemagicClient() as client:
            return await client.delete_all_caches(app_id)
  • Client method delete_all_caches that sends a DELETE HTTP request to '/apps/{app_id}/caches'.
    async def delete_all_caches(self, app_id: str) -> Any:
        return await self._delete(f"/apps/{app_id}/caches")
  • The register() function in caches.py that registers the tool with the MCP server via the @mcp.tool() decorator.
    def register(mcp: FastMCP) -> None:
        @mcp.tool()
        async def list_caches(app_id: str) -> Any:
            """List all build caches for a Codemagic application.
    
            Args:
                app_id: The Codemagic application ID.
            """
            async with CodemagicClient() as client:
                return await client.list_caches(app_id)
    
        @mcp.tool(annotations=ToolAnnotations(destructiveHint=True))
        async def delete_all_caches(app_id: str) -> Any:
            """Delete all build caches for a Codemagic application.
    
            Args:
                app_id: The Codemagic application ID.
            """
            async with CodemagicClient() as client:
                return await client.delete_all_caches(app_id)
    
        @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)
  • The register_all_tools function which calls caches.register(mcp) to register all cache tools including delete_all_caches.
    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)
  • Server initialization that calls register_all_tools(mcp) and mentions delete_all_caches in its instructions as a destructive operation.
    mcp = FastMCP(
        name="Codemagic MCP",
        instructions=(
            "Codemagic CI/CD REST API: manage builds, apps, artifacts, caches, variables, and webhooks.\n\n"
            "Destructive ops (delete_app, cancel_build, delete_cache, delete_all_caches, delete_variable, delete_webhook): confirm before executing.\n\n"
            "App ID resolution: (1) use explicit app_id; (2) use CODEMAGIC_DEFAULT_APP_ID if set (exposed as `default_app_id`); "
            "(3) call list_apps — auto-select if one result, else ask user."
        ),
        lifespan=lifespan,
    )
    
    register_all_tools(mcp)
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The annotation destructiveHint already signals the destructive nature, and the description adds that it deletes 'all' caches, which is additional context. However, it does not disclose behavioral details such as irreversibility, scope (e.g., all apps or one app), or async behavior, leaving gaps beyond the annotation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise, using two short sentences that front-load the purpose. No unnecessary words or repetition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool is destructive and has no output schema, the description lacks critical information such as return value, synchronization, or warnings beyond the annotation. It feels incomplete for a potentially impactful operation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It only restates the schema property name ('The Codemagic application ID') without adding meaning like how to obtain the ID or format constraints, providing minimal value over the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Delete' and the resource 'all build caches' for a specific application. It distinguishes from the sibling tool 'delete_cache' by emphasizing 'all', making the purpose unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like delete_cache, nor does it mention prerequisites or context for the operation. Users must infer usage from the name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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