Skip to main content
Glama
argoproj-labs

argocd-mcp

Official

list_applications

Retrieve and manage applications deployed in ArgoCD by searching, filtering, and paginating through the application list.

Instructions

list_applications returns list of applications

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
searchNoSearch applications by name. This is a partial match on the application name and does not support glob patterns (e.g. "*"). Optional.
limitNoMaximum number of applications to return. Use this to reduce token usage when there are many applications. Optional.
offsetNoNumber of applications to skip before returning results. Use with limit for pagination. Optional.

Implementation Reference

  • Core implementation of listApplications: calls ArgoCD API /api/v1/applications, strips heavy fields for token efficiency, applies pagination, returns paginated list with metadata.
    public 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
        }
      };
    }
  • Registers the 'list_applications' MCP tool: defines name, description, Zod input schema (search, limit, offset), and thin handler delegating 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
        })
    );
  • Input schema for 'list_applications' tool using Zod: optional search string, positive integer limit, non-negative integer offset with descriptions.
    {
      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.'
        )
    },
  • Helper method to register MCP tools with automatic JSON stringification of results and error handling.
    private addJsonOutputTool<Args extends ZodRawShape, T>(
      name: string,
      description: string,
      paramsSchema: Args,
      cb: (...cbArgs: Parameters<ToolCallback<Args>>) => T
    ) {
      this.tool(name, description, paramsSchema as ZodRawShape, async (...args) => {
        try {
          const result = await cb.apply(this, args as Parameters<ToolCallback<Args>>);
          return {
            isError: false,
            content: [{ type: 'text', text: JSON.stringify(result) }]
          };
        } catch (error) {
          return {
            isError: true,
            content: [{ type: 'text', text: error instanceof Error ? error.message : String(error) }]
          };
        }
      });
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool returns a list but fails to describe key behaviors such as pagination handling (implied by limit/offset parameters), search functionality, error conditions, or output format. This is a significant gap for a tool with parameters and no output schema, making it inadequate for safe and effective use.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with a single sentence, which is front-loaded and wastes no words. However, this brevity comes at the cost of under-specification, as it omits necessary details. While efficient, it fails to provide adequate information, slightly reducing its effectiveness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (3 parameters, no annotations, no output schema, and multiple sibling tools), the description is incomplete. It lacks behavioral context, usage guidelines, and output details, making it insufficient for an agent to understand how to invoke the tool correctly or interpret results. The high schema coverage helps but does not fully compensate for these gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description does not mention any parameters, but the input schema has 100% description coverage, providing clear documentation for 'search', 'limit', and 'offset'. Since schema coverage is high (>80%), the baseline score is 3, as the description adds no value beyond what the schema already explains. However, it does not compensate for or enhance parameter understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose2/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'list_applications returns list of applications' is tautological, essentially restating the tool name with minimal added value. It does not specify what type of applications (e.g., software, cloud, or organizational) or provide any distinguishing context from sibling tools like 'get_resources' or 'get_application'. While it includes a verb ('returns'), it lacks specificity about the resource scope or purpose beyond the obvious.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It does not mention sibling tools like 'get_application' (for single applications) or 'get_resources' (for broader resources), nor does it specify prerequisites, contexts, or exclusions. This leaves the agent without direction on tool selection in a server with multiple related tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/argoproj-labs/argocd-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server