get_resource_events
Retrieve events for a Kubernetes resource managed by an ArgoCD application. Provide application details and resource identifiers to get relevant event logs.
Instructions
get_resource_events returns events for a resource that is managed by an application
Input 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. | |
| resourceUID | Yes | ||
| resourceNamespace | Yes | ||
| resourceName | Yes |
Implementation Reference
- src/argocd/client.ts:279-296 (handler)The actual implementation of getResourceEvents in ArgoCDClient. Makes an HTTP GET request to /api/v1/applications/{applicationName}/events with query params for appNamespace, resourceNamespace, resourceUID, and resourceName. Returns a V1EventList.
public async getResourceEvents( applicationName: string, applicationNamespace: string, resourceUID: string, resourceNamespace: string, resourceName: string ) { const { body } = await this.client.get<V1EventList>( `/api/v1/applications/${applicationName}/events`, { appNamespace: applicationNamespace, resourceNamespace, resourceUID, resourceName } ); return body; } - src/shared/models/schema.ts:3-11 (schema)ApplicationNamespaceSchema definition - validates the application namespace field used in the tool's input schema.
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.` ); - src/server/server.ts:166-190 (registration)Registration of the 'get_resource_events' tool using addJsonOutputTool. Defines input parameters (applicationName, applicationNamespace, resourceUID, resourceNamespace, resourceName) and the callback that invokes argocdClient.getResourceEvents.
this.addJsonOutputTool( 'get_resource_events', 'get_resource_events returns events for a resource that is managed by an application', { applicationName: z.string(), applicationNamespace: ApplicationNamespaceSchema, resourceUID: z.string(), resourceNamespace: z.string(), resourceName: z.string() }, async ({ applicationName, applicationNamespace, resourceUID, resourceNamespace, resourceName }) => await this.argocdClient.getResourceEvents( applicationName, applicationNamespace, resourceUID, resourceNamespace, resourceName ) );