update_application
Modify application configurations in ArgoCD, including metadata, source details, sync policies, and destination settings, to ensure proper deployment and synchronization.
Instructions
update_application updates application
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| application | Yes | ||
| applicationName | Yes |
Implementation Reference
- src/server/server.ts:222-231 (registration)Registers the MCP tool 'update_application' with input schema and inline handler that calls ArgoCDClient.updateApplication'update_application', 'update_application updates application', { applicationName: z.string(), application: ApplicationSchema }, async ({ applicationName, application }) => await this.argocdClient.updateApplication( applicationName, application as V1alpha1Application ) ); this.addJsonOutputTool(
- src/argocd/client.ts:86-92 (handler)Core handler function that executes the HTTP PUT request to the ArgoCD API to update the specified applicationpublic async updateApplication(applicationName: string, application: V1alpha1Application) { const { body } = await this.client.put<V1alpha1Application, V1alpha1Application>( `/api/v1/applications/${applicationName}`, null, application ); return body;
- src/shared/models/schema.ts:22-67 (schema)Zod schema defining the structure of the application object passed to the tool, used for input validationexport 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.` ) }) });