create_application
Deploy applications in ArgoCD by specifying metadata, source repository, sync policies, and destination targets to automate and manage Kubernetes deployments.
Instructions
create_application creates application
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| application | Yes |
Implementation Reference
- src/argocd/client.ts:77-84 (handler)The core handler logic that executes the HTTP POST request to the ArgoCD API to create a new application.public async createApplication(application: V1alpha1Application) { const { body } = await this.client.post<V1alpha1Application, V1alpha1Application>( `/api/v1/applications`, null, application ); return body; }
- src/server/server.ts:215-220 (registration)MCP tool registration for 'create_application' using addJsonOutputTool, providing description, input schema, and handler callback that delegates to ArgoCDClient.'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) );
- 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.` ) }) });