Skip to main content
Glama
akuity
by akuity

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; }

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/akuity/argocd-mcp'

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