Skip to main content
Glama

sync_application

Synchronize ArgoCD applications with specified revisions, resources, and strategies. Supports pruning, dry runs, and custom namespaces to manage application deployments effectively.

Instructions

Sync an application in ArgoCD

Args:
    name: The name of the application to sync (required)
    revision: Git revision to sync to (optional)
    prune: Whether to prune resources (default: False)
    dry_run: Whether to perform a dry run (default: False)
    strategy: Sync strategy ("apply" or "hook")
    resources: List of resources to sync (optional)
    namespace: The application namespace (optional)

Returns:
    Sync result details

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dry_runNo
nameYes
namespaceNo
pruneNo
resourcesNo
revisionNo
strategyNo

Implementation Reference

  • The main handler function for the "sync_application" MCP tool. It constructs the sync request payload based on input parameters and performs a POST request to the ArgoCD API endpoint `/applications/{name}/sync` to initiate synchronization.
    async def sync_application(
        name: str,
        revision: str = "",
        prune: bool = False,
        dry_run: bool = False,
        strategy: str = "",
        resources: Optional[List[Dict[str, str]]] = None,
        namespace: str = "",
    ) -> Dict[str, Any]:
        """
        Sync an application in ArgoCD
    
        Args:
            name: The name of the application to sync (required)
            revision: Git revision to sync to (optional)
            prune: Whether to prune resources (default: False)
            dry_run: Whether to perform a dry run (default: False)
            strategy: Sync strategy ("apply" or "hook")
            resources: List of resources to sync (optional)
            namespace: The application namespace (optional)
    
        Returns:
            Sync result details
        """
        data = {"name": name, "prune": prune, "dryRun": dry_run}
    
        if revision:
            data["revision"] = revision
    
        if strategy and strategy in ["apply", "hook"]:
            data["strategy"] = {"hook": {}} if strategy == "hook" else {"apply": {}}
    
        if resources:
            data["resources"] = resources
    
        params = {}
        if namespace:
            params["appNamespace"] = namespace
    
        success, response = await make_api_request(
            f"applications/{name}/sync", method="POST", data=data, params=params
        )
    
        if success:
            logger.info(f"Application '{name}' sync initiated")
            return response
        else:
            logger.error(f"Failed to sync application '{name}': {response.get('error')}")
            return {"error": response.get("error", f"Failed to sync application '{name}'")}
  • server.py:46-46 (registration)
    Registers the `sync_application` function as an MCP tool using the `mcp.tool()` decorator in the FastMCP server.
    mcp.tool()(applications.sync_application)
  • server.py:18-18 (registration)
    Import statement that brings the `sync_application` handler into scope for registration in the MCP server.
    import tools.settings as settings
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While 'sync' implies a mutation operation, the description doesn't explain what 'sync' actually does in ArgoCD (e.g., deploying manifests, reconciling state), what permissions are required, whether it's idempotent, or potential side effects like resource pruning. The parameter descriptions add some behavioral context but not enough for a mutation tool.

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

Conciseness4/5

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

The description is well-structured with clear sections for Args and Returns. Each parameter gets exactly one line of explanation. While efficient, the opening sentence could be more informative about what 'sync' means in ArgoCD context. No wasted words, but room for more front-loaded context.

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

Completeness3/5

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

For a mutation tool with 7 parameters, no annotations, and no output schema, the description is minimally adequate. It covers parameters well but lacks crucial behavioral context about what 'sync' actually does, error conditions, permissions needed, or what the 'Sync result details' return contains. The sibling context suggests this is part of a GitOps workflow, but the description doesn't leverage this context.

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

Parameters4/5

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

With 0% schema description coverage, the description compensates well by documenting all 7 parameters with clear semantics: required/optional status, defaults, and brief explanations of what each parameter controls. The description adds significant value beyond the bare schema, though it could provide more context about parameter interactions (e.g., how 'resources' interacts with 'prune').

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

Purpose4/5

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

The description clearly states the verb ('sync') and resource ('an application in ArgoCD'), making the purpose immediately understandable. However, it doesn't explicitly differentiate this from sibling tools like 'update_application' or 'create_application', which might have overlapping functionality in a GitOps context.

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 'update_application' or 'create_application'. There's no mention of prerequisites, typical use cases, or scenarios where sync might be preferred over other operations in the ArgoCD context.

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

Related 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/severity1/argocd-mcp'

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