create_application
Deploy applications to Kubernetes clusters by creating ArgoCD application resources with specified source repositories, sync policies, and destination targets.
Instructions
create_application creates a new ArgoCD application in the specified namespace. The application.metadata.namespace field determines where the Application resource will be created (e.g., "argocd", "argocd-apps", or any custom namespace).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| application | Yes |
Implementation Reference
- src/argocd/client.ts:77-84 (handler)Core implementation of application creation: performs HTTP POST to ArgoCD API /api/v1/applications with the application manifest.public async createApplication(application: V1alpha1Application) { const { body } = await this.client.post<V1alpha1Application, V1alpha1Application>( `/api/v1/applications`, null, application ); return body; }
- src/shared/models/schema.ts:22-67 (schema)Zod schema defining the input structure for the 'application' parameter, used for validation in the tool registration.export const ApplicationSchema = z.object({ metadata: z.object({ name: z.string(), namespace: ApplicationNamespaceSchema }), spec: z.object({ project: z.string(), source: z.object({ repoURL: z.string(), path: z.string(), targetRevision: z.string() }), syncPolicy: z.object({ syncOptions: z.array(z.string()), automated: z.object({ prune: z.boolean(), selfHeal: z.boolean() }).optional(), retry: z .object({ limit: z.number(), backoff: z.object({ duration: z.string(), maxDuration: z.string(), factor: z.number() }) }) }), destination: z.object({ server: z.string().optional(), namespace: z.string().optional(), name: z.string().optional() }) .refine( (data: { server?: string; name?: string }) => (!data.server && !!data.name) || (!!data.server && !data.name), { message: "Only one of server or name must be specified in destination" } ) .describe( `The destination of the application. Only one of server or name must be specified.` ) }) });
- src/server/server.ts:214-220 (registration)Registers the MCP tool 'create_application' with name, description, input schema {application: ApplicationSchema}, and handler that delegates to ArgoCDClient.createApplication.this.addJsonOutputTool( 'create_application', 'create_application creates a new ArgoCD application in the specified namespace. The application.metadata.namespace field determines where the Application resource will be created (e.g., "argocd", "argocd-apps", or any custom namespace).', { application: ApplicationSchema }, async ({ application }) => await this.argocdClient.createApplication(application as V1alpha1Application) );