get_resource_events
Retrieve events for a specific resource managed by an application, using application and resource details to ensure accurate tracking and monitoring.
Instructions
get_resource_events returns events for a resource that is managed by an application
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| applicationName | Yes | ||
| applicationNamespace | Yes | The namespace of the application. Note that this may differ from the namespace of individual resources. Make sure to verify the application namespace in the Application resource — it is often argocd, but not always. | |
| resourceName | Yes | ||
| resourceNamespace | Yes | ||
| resourceUID | Yes |
Implementation Reference
- src/server/server.ts:142-166 (registration)Registration of the MCP 'get_resource_events' tool, including description, Zod input schema, and anonymous handler function that delegates to the ArgoCD client's getResourceEvents method.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 ) );
- src/server/server.ts:145-150 (schema)Zod schema defining the input parameters for the 'get_resource_events' tool.{ applicationName: z.string(), applicationNamespace: ApplicationNamespaceSchema, resourceUID: z.string(), resourceNamespace: z.string(), resourceName: z.string()
- src/server/server.ts:152-165 (handler)Anonymous async handler function for the 'get_resource_events' tool, which invokes the ArgoCD client method with the parsed parameters.async ({ applicationName, applicationNamespace, resourceUID, resourceNamespace, resourceName }) => await this.argocdClient.getResourceEvents( applicationName, applicationNamespace, resourceUID, resourceNamespace, resourceName )
- src/argocd/client.ts:261-278 (helper)Implementation of getResourceEvents in ArgoCDClient class, performing a GET request to the ArgoCD API endpoint for resource events with the specified filters.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; }