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
| Name | Required | Description | Default |
|---|---|---|---|
| applicationName | Yes | ||
| applicationNamespace | No | The namespace where the application is located. Required if application is not in the default namespace. | |
| cascade | No | Whether to cascade the deletion to child resources | |
| propagationPolicy | No | Deletion propagation policy (e.g., "Foreground", "Background", "Orphan") |
Implementation Reference
- src/argocd/client.ts:95-120 (handler)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; }
- src/server/server.ts:231-259 (registration)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 ); } );
- src/server/server.ts:234-247 (schema)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")') },