get_application_workload_logs
Retrieve logs for ArgoCD application workloads like Deployments, StatefulSets, and Pods to monitor and troubleshoot Kubernetes resources by specifying application name, namespace, and resource reference.
Instructions
get_application_workload_logs returns logs for application workload (Deployment, StatefulSet, Pod, etc.) by application name and resource ref and optionally container name
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| applicationName | Yes | ||
| applicationNamespace | Yes | The namespace where the ArgoCD application resource will be created. This is the namespace of the Application resource itself, not the destination namespace for the application's resources. You can specify any valid Kubernetes namespace (e.g., 'argocd', 'argocd-apps', 'my-namespace', etc.). The default ArgoCD namespace is typically 'argocd', but you can use any namespace you prefer. | |
| resourceRef | Yes | ||
| container | Yes |
Implementation Reference
- src/argocd/client.ts:197-220 (handler)Implements the core logic for fetching workload logs from the ArgoCD API using a streaming GET request with parameters specific to the workload resource and container.public async getWorkloadLogs( applicationName: string, applicationNamespace: string, resourceRef: V1alpha1ResourceResult, container: string ) { const logs: ApplicationLogEntry[] = []; await this.client.getStream<ApplicationLogEntry>( `/api/v1/applications/${applicationName}/logs`, { appNamespace: applicationNamespace, namespace: resourceRef.namespace, resourceName: resourceRef.name, group: resourceRef.group, kind: resourceRef.kind, version: resourceRef.version, follow: false, tailLines: 100, container: container }, (chunk) => logs.push(chunk) ); return logs; }
- src/server/server.ts:119-135 (registration)Registers the MCP tool 'get_application_workload_logs' with its description, Zod input schema, and thin handler that delegates to ArgoCDClient.getWorkloadLogs.this.addJsonOutputTool( 'get_application_workload_logs', 'get_application_workload_logs returns logs for application workload (Deployment, StatefulSet, Pod, etc.) by application name and resource ref and optionally container name', { applicationName: z.string(), applicationNamespace: ApplicationNamespaceSchema, resourceRef: ResourceRefSchema, container: z.string() }, async ({ applicationName, applicationNamespace, resourceRef, container }) => await this.argocdClient.getWorkloadLogs( applicationName, applicationNamespace, resourceRef as V1alpha1ResourceResult, container ) );
- src/shared/models/schema.ts:13-20 (schema)Zod schema for ResourceRef type used in the tool's input validation.export const ResourceRefSchema = z.object({ uid: z.string(), kind: z.string(), namespace: z.string(), name: z.string(), version: z.string(), group: z.string() });
- src/shared/models/schema.ts:3-11 (schema)Zod schema for ApplicationNamespace used in the tool's input validation.export const ApplicationNamespaceSchema = z .string() .min(1) .describe( `The namespace where the ArgoCD application resource will be created. This is the namespace of the Application resource itself, not the destination namespace for the application's resources. You can specify any valid Kubernetes namespace (e.g., 'argocd', 'argocd-apps', 'my-namespace', etc.). The default ArgoCD namespace is typically 'argocd', but you can use any namespace you prefer.` );