list_applications
Retrieve a list of applications managed by the ArgoCD MCP server, with optional filtering by name for partial matches.
Instructions
list_applications returns list of applications
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| search | No | Search applications by name. This is a partial match on the application name and does not support glob patterns (e.g. "*"). Optional. |
Implementation Reference
- src/server/server.ts:35-67 (registration)Registration of the 'list_applications' MCP tool using addJsonOutputTool, including tool name, description, input schema (search, limit, offset), and handler that delegates to ArgoCDClient.listApplications'list_applications', 'list_applications returns list of applications', { search: z .string() .optional() .describe( 'Search applications by name. This is a partial match on the application name and does not support glob patterns (e.g. "*"). Optional.' ), limit: z .number() .int() .positive() .optional() .describe( 'Maximum number of applications to return. Use this to reduce token usage when there are many applications. Optional.' ), offset: z .number() .int() .min(0) .optional() .describe( 'Number of applications to skip before returning results. Use with limit for pagination. Optional.' ) }, async ({ search, limit, offset }) => await this.argocdClient.listApplications({ search: search ?? undefined, limit, offset }) );
- src/server/server.ts:37-60 (schema)Zod input schema definition for the list_applications tool parameters: search (optional string), limit (optional positive integer), offset (optional non-negative integer){ search: z .string() .optional() .describe( 'Search applications by name. This is a partial match on the application name and does not support glob patterns (e.g. "*"). Optional.' ), limit: z .number() .int() .positive() .optional() .describe( 'Maximum number of applications to return. Use this to reduce token usage when there are many applications. Optional.' ), offset: z .number() .int() .min(0) .optional() .describe( 'Number of applications to skip before returning results. Use with limit for pagination. Optional.' ) },
- src/argocd/client.ts:25-66 (handler)Core implementation of listApplications in ArgoCDClient: calls ArgoCD API /api/v1/applications with search, strips heavy fields from applications to optimize MCP token usage, applies limit/offset pagination client-side, returns paginated items with metadatapublic async listApplications(params?: { search?: string; limit?: number; offset?: number }) { const { body } = await this.client.get<V1alpha1ApplicationList>( `/api/v1/applications`, params?.search ? { search: params.search } : undefined ); // Strip heavy fields to reduce token usage const strippedItems = body.items?.map((app) => ({ metadata: { name: app.metadata?.name, namespace: app.metadata?.namespace, labels: app.metadata?.labels, creationTimestamp: app.metadata?.creationTimestamp }, spec: { project: app.spec?.project, source: app.spec?.source, destination: app.spec?.destination }, status: { sync: app.status?.sync, health: app.status?.health, summary: app.status?.summary } })) ?? []; // Apply pagination const start = params?.offset ?? 0; const end = params?.limit ? start + params.limit : strippedItems.length; const items = strippedItems.slice(start, end); return { items, metadata: { resourceVersion: body.metadata?.resourceVersion, totalItems: strippedItems.length, returnedItems: items.length, hasMore: end < strippedItems.length } }; }