Skip to main content
Glama
argoproj-labs

argocd-mcp

Official

get_resource_actions

Retrieve available actions for a Kubernetes resource managed by an ArgoCD application.

Instructions

get_resource_actions returns actions for a resource that is managed by an 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.
resourceRefYes

Implementation Reference

  • Registration of the get_resource_actions MCP tool via addJsonOutputTool with its handler callback that delegates to argocdClient.getResourceActions
    this.addJsonOutputTool(
      'get_resource_actions',
      'get_resource_actions returns actions for a resource that is managed by an application',
      {
        applicationName: z.string(),
        applicationNamespace: ApplicationNamespaceSchema,
        resourceRef: ResourceRefSchema
      },
      async ({ applicationName, applicationNamespace, resourceRef }) =>
        await this.argocdClient.getResourceActions(
          applicationName,
          applicationNamespace,
          resourceRef as V1alpha1ResourceResult
        )
    );
  • Actual implementation: calls ArgoCD API GET /api/v1/applications/{name}/resource/actions with query parameters and returns the response body containing actions
    public async getResourceActions(
      applicationName: string,
      applicationNamespace: string,
      resourceRef: V1alpha1ResourceResult
    ) {
      const { body } = await this.client.get<{ actions: V1alpha1ResourceAction[] }>(
        `/api/v1/applications/${applicationName}/resource/actions`,
        {
          appNamespace: applicationNamespace,
          namespace: resourceRef.namespace,
          resourceName: resourceRef.name,
          group: resourceRef.group,
          kind: resourceRef.kind,
          version: resourceRef.version
        }
      );
      return body;
    }
  • Zod schema for the resourceRef input parameter (uid, kind, namespace, name, version, group)
    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 input parameter
    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 method addJsonOutputTool that wraps McpServer.tool() with 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?

With no annotations provided, the description must fully disclose behavioral traits. It only mentions returning actions but does not confirm read-only nature, nor does it discuss permissions, side effects, or what happens if the resource is not found. The minimal information is insufficient for a safe agent invocation.

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 a single sentence with no waste, achieving conciseness. However, it could be improved with additional context without becoming verbose, but overall it is appropriately sized.

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?

The tool has three parameters including a nested object, no output schema, and no annotations. The description does not explain the return format or behavior beyond 'returns actions'. Given the complexity, the description lacks completeness and should provide more detail.

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 only 33% (only applicationNamespace has a description). The tool description does not add any meaning beyond the schema for the other parameters (applicationName, resourceRef). Since the description fails to compensate for the low coverage, the score is low.

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 that the tool returns actions for a resource managed by an application, using a specific verb and resource. However, it does not distinguish from sibling tools like run_resource_action or get_resource_events, so it loses a point for lack of differentiation.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives, such as using it to list available actions before calling run_resource_action. This lack of context makes it harder for an AI agent to decide correctly.

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