Skip to main content
Glama
argoproj-labs

argocd-mcp

Official

get_resources

Retrieve Kubernetes manifests for specific resources or all resources managed by an ArgoCD application to inspect deployment configurations.

Instructions

get_resources return manifests for resources specified by resourceRefs. If resourceRefs is empty or not provided, fetches all resources managed by the application.

Input Schema

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

Implementation Reference

  • The MCP tool handler function for 'get_resources'. If no resourceRefs provided, fetches the application resource tree and extracts refs, then fetches manifests in parallel using ArgoCDClient.getResource.
    async ({ applicationName, applicationNamespace, resourceRefs }) => {
      let refs = resourceRefs || [];
      if (refs.length === 0) {
        const tree = await this.argocdClient.getApplicationResourceTree(applicationName);
        refs =
          tree.nodes?.map((node) => ({
            uid: node.uid!,
            version: node.version!,
            group: node.group!,
            kind: node.kind!,
            name: node.name!,
            namespace: node.namespace!
          })) || [];
      }
      return Promise.all(
        refs.map((ref) =>
          this.argocdClient.getResource(applicationName, applicationNamespace, ref)
        )
      );
    }
  • Zod schema defining the ResourceRef object used in the get_resources tool input for specifying resources.
    export const ResourceRefSchema = z.object({
      uid: z.string(),
      kind: z.string(),
      namespace: z.string(),
      name: z.string(),
      version: z.string(),
      group: z.string()
    });
  • Zod schema for the applicationNamespace parameter used in get_resources tool input.
    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.`
      );
  • Registration of the 'get_resources' MCP tool, specifying name, description, input schema, and handler callback.
    this.addJsonOutputTool(
      'get_resources',
      'get_resources return manifests for resources specified by resourceRefs. If resourceRefs is empty or not provided, fetches all resources managed by the application.',
      {
        applicationName: z.string(),
        applicationNamespace: ApplicationNamespaceSchema,
        resourceRefs: ResourceRefSchema.array().optional()
      },
      async ({ applicationName, applicationNamespace, resourceRefs }) => {
        let refs = resourceRefs || [];
        if (refs.length === 0) {
          const tree = await this.argocdClient.getApplicationResourceTree(applicationName);
          refs =
            tree.nodes?.map((node) => ({
              uid: node.uid!,
              version: node.version!,
              group: node.group!,
              kind: node.kind!,
              name: node.name!,
              namespace: node.namespace!
            })) || [];
        }
        return Promise.all(
          refs.map((ref) =>
            this.argocdClient.getResource(applicationName, applicationNamespace, ref)
          )
        );
      }
    );
  • ArgoCDClient helper method to fetch the manifest of a specific resource via the ArgoCD API, used by the get_resources tool handler.
    public async getResource(
      applicationName: string,
      applicationNamespace: string,
      resourceRef: V1alpha1ResourceResult
    ) {
      const { body } = await this.client.get<V1alpha1ApplicationResourceResult>(
        `/api/v1/applications/${applicationName}/resource`,
        {
          appNamespace: applicationNamespace,
          namespace: resourceRef.namespace,
          resourceName: resourceRef.name,
          group: resourceRef.group,
          kind: resourceRef.kind,
          version: resourceRef.version
        }
      );
      return body.manifest;
    }
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. It describes the behavior of fetching manifests based on resourceRefs, but lacks critical details such as whether this is a read-only operation (implied by 'get' but not stated), authentication requirements, rate limits, error handling, or the format of returned manifests. For a tool with no annotations, this leaves significant behavioral gaps.

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 concise with two sentences that efficiently convey the core functionality. It is front-loaded with the primary purpose and includes a conditional case. There's no wasted text, though it could be slightly more structured for clarity.

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 complexity (3 parameters, no annotations, no output schema, and low schema coverage), the description is incomplete. It lacks details on behavioral traits, full parameter meanings, and output format, which are crucial for an AI agent to use this tool effectively in context with its siblings.

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?

Schema description coverage is 33% (only applicationNamespace has a description), and the description adds some context by explaining the effect of resourceRefs (empty vs. provided) and mentioning 'resources managed by the application.' However, it doesn't elaborate on the semantics of applicationName or the structure of resourceRefs objects beyond what the schema implies. With low schema coverage, the description partially compensates but not fully.

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

Purpose4/5

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

The description clearly states the tool's purpose: 'return manifests for resources specified by resourceRefs' and 'fetches all resources managed by the application' when resourceRefs is empty. It specifies the verb ('return/fetches') and resource ('manifests for resources'), though it doesn't explicitly differentiate from siblings like get_application_managed_resources or get_application_resource_tree.

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 implies usage through the condition 'If resourceRefs is empty or not provided, fetches all resources managed by the application,' which suggests when to use it for specific vs. all resources. However, it doesn't provide explicit guidance on when to choose this tool over similar siblings like get_application_managed_resources or get_application_resource_tree, nor does it mention prerequisites or exclusions.

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