Skip to main content
Glama
argoproj-labs

argocd-mcp

Official

delete_application

Remove an ArgoCD application from your Kubernetes cluster, optionally specifying namespace, cascade deletion, and propagation policy for proper cleanup.

Instructions

delete_application deletes application. Specify applicationNamespace if the application is in a non-default namespace to avoid permission errors.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
applicationNameYes
applicationNamespaceNoThe namespace where the application is located. Required if application is not in the default namespace.
cascadeNoWhether to cascade the deletion to child resources
propagationPolicyNoDeletion propagation policy (e.g., "Foreground", "Background", "Orphan")

Implementation Reference

  • The ArgoCDClient.deleteApplication method implements the core logic for deleting an ArgoCD application via HTTP DELETE request to the ArgoCD API, handling optional parameters like namespace, cascade, and propagation policy.
    public async deleteApplication(
      applicationName: string,
      options?: {
        appNamespace?: string;
        cascade?: boolean;
        propagationPolicy?: string;
      }
    ) {
      const queryParams: Record<string, string | boolean> = {};
    
      if (options?.appNamespace) {
        queryParams.appNamespace = options.appNamespace;
      }
      if (options?.cascade !== undefined) {
        queryParams.cascade = options.cascade;
      }
      if (options?.propagationPolicy) {
        queryParams.propagationPolicy = options.propagationPolicy;
      }
    
      const { body } = await this.client.delete<V1alpha1Application>(
        `/api/v1/applications/${applicationName}`,
        Object.keys(queryParams).length > 0 ? queryParams : undefined
      );
      return body;
    }
  • MCP tool registration for 'delete_application', including input schema validation with Zod and the thin wrapper handler that delegates to ArgoCDClient.deleteApplication.
    this.addJsonOutputTool(
      'delete_application',
      'delete_application deletes application. Specify applicationNamespace if the application is in a non-default namespace to avoid permission errors.',
      {
        applicationName: z.string(),
        applicationNamespace: ApplicationNamespaceSchema.optional().describe(
          'The namespace where the application is located. Required if application is not in the default namespace.'
        ),
        cascade: z
          .boolean()
          .optional()
          .describe('Whether to cascade the deletion to child resources'),
        propagationPolicy: z
          .string()
          .optional()
          .describe('Deletion propagation policy (e.g., "Foreground", "Background", "Orphan")')
      },
      async ({ applicationName, applicationNamespace, cascade, propagationPolicy }) => {
        const options: Record<string, string | boolean> = {};
        if (applicationNamespace) options.appNamespace = applicationNamespace;
        if (cascade !== undefined) options.cascade = cascade;
        if (propagationPolicy) options.propagationPolicy = propagationPolicy;
    
        return await this.argocdClient.deleteApplication(
          applicationName,
          Object.keys(options).length > 0 ? options : undefined
        );
      }
    );
  • Input schema for the 'delete_application' tool using Zod for validation of parameters: applicationName (required string), applicationNamespace (optional), cascade (optional boolean), propagationPolicy (optional string).
    {
      applicationName: z.string(),
      applicationNamespace: ApplicationNamespaceSchema.optional().describe(
        'The namespace where the application is located. Required if application is not in the default namespace.'
      ),
      cascade: z
        .boolean()
        .optional()
        .describe('Whether to cascade the deletion to child resources'),
      propagationPolicy: z
        .string()
        .optional()
        .describe('Deletion propagation policy (e.g., "Foreground", "Background", "Orphan")')
    },
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. It acknowledges this is a deletion operation (destructive) and mentions permission errors, but doesn't describe what gets destroyed, whether deletion is reversible, what happens to dependent resources, or any rate limits. The mention of 'permission errors' hints at authentication needs but doesn't specify required permissions. For a destructive tool with zero annotation coverage, this leaves significant behavioral gaps.

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 appropriately concise with two sentences that each serve a purpose. The first establishes the basic operation (though tautologically), and the second provides important namespace guidance. No wasted words, though the tautological opening could be improved. The structure is front-loaded with the core action.

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?

For a destructive tool with 4 parameters, no annotations, and no output schema, the description is inadequate. It doesn't explain what happens after deletion (success/failure responses), doesn't clarify the scope of what gets deleted, and provides minimal guidance on parameter usage. Given the complexity of a deletion operation with cascade and propagation options, the description should provide more complete context about the tool's behavior and consequences.

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

Parameters3/5

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

Schema description coverage is 75% (3 of 4 parameters have descriptions), so the baseline is 3. The description adds minimal value beyond the schema - it mentions namespace specification to avoid permission errors, which provides context for the applicationNamespace parameter but doesn't add meaningful semantics for the other parameters. It doesn't explain the relationship between cascade and propagationPolicy or when to use them.

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

Purpose2/5

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

The description states 'delete_application deletes application' which is a tautology that merely restates the tool name. While it mentions specifying namespace to avoid permission errors, it doesn't clarify what type of application is being deleted (e.g., Kubernetes application, cloud application) or what resources are affected. It doesn't distinguish this destructive operation from sibling tools like 'update_application' or 'sync_application' beyond the obvious verb difference.

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 minimal guidance about when to use this tool - only mentioning namespace specification to avoid permission errors. It doesn't explain when to choose deletion over other operations, what prerequisites exist (e.g., should the application be stopped first?), or when to use cascade/propagation parameters. No alternatives are mentioned, and there's no guidance about when NOT to use this destructive operation.

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/argoproj-labs/argocd-mcp'

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