Skip to main content
Glama
argoproj-labs

argocd-mcp

Official

get_application

Get an ArgoCD application by name. Specify a namespace to retrieve applications from non-default namespaces.

Instructions

get_application returns application by application name. Optionally specify the application namespace to get applications from non-default namespaces.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
applicationNameYes
applicationNamespaceNoThe 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.

Implementation Reference

  • Registration of the 'get_application' tool on the MCP server with input schema and callback.
    this.addJsonOutputTool(
      'get_application',
      'get_application returns application by application name. Optionally specify the application namespace to get applications from non-default namespaces.',
      {
        applicationName: z.string(),
        applicationNamespace: ApplicationNamespaceSchema.optional()
      },
      async ({ applicationName, applicationNamespace }) =>
        await this.argocdClient.getApplication(applicationName, applicationNamespace)
    );
  • Handler that executes the tool logic: makes an HTTP GET request to the ArgoCD API to fetch an application by name, optionally filtered by namespace.
    public async getApplication(applicationName: string, appNamespace?: string) {
      const queryParams = appNamespace ? { appNamespace } : undefined;
      const { body } = await this.client.get<V1alpha1Application>(
        `/api/v1/applications/${applicationName}`,
        queryParams
      );
      return body;
    }
  • Zod schema for the optional 'applicationNamespace' parameter used by the tool.
    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.`
      );
  • Helper wrapper that registers the tool with the MCP server and JSON-serializes the result.
    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, and the description lacks details on behavior such as error handling, default namespace behavior, or that it is a read-only operation. Only the optional namespace is mentioned.

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

Conciseness5/5

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

The description is a single sentence with 17 words, front-loading the purpose and key behavior. No unnecessary information.

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

Completeness3/5

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

For a simple get operation with two parameters and no output schema, the description is adequate but could benefit from specifying default namespace, error responses, or return value structure.

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

Parameters2/5

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

Schema coverage is 50%, with only the namespace parameter having a description. The tool description adds that namespace is optional and for non-default namespaces but does not explain the applicationName parameter format or constraints.

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

Purpose5/5

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

The description clearly states the tool retrieves an application by name, with an optional namespace parameter. It distinguishes from siblings like list_applications by specifying retrieval of a single application by name.

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

Usage Guidelines3/5

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

The description mentions using the namespace parameter for non-default namespaces but does not provide explicit when-to-use or when-not-to-use guidance compared to other tools like get_application_events or list_applications.

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