Skip to main content
Glama
argoproj-labs

argocd-mcp

Official

get_application_workload_logs

Retrieve logs for ArgoCD application workloads like Deployments, StatefulSets, and Pods to monitor and troubleshoot Kubernetes resources by specifying application name, namespace, and resource reference.

Instructions

get_application_workload_logs returns logs for application workload (Deployment, StatefulSet, Pod, etc.) by application name and resource ref and optionally container name

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
containerYes

Implementation Reference

  • Implements the core logic for fetching workload logs from the ArgoCD API using a streaming GET request with parameters specific to the workload resource and container.
    public async getWorkloadLogs(
      applicationName: string,
      applicationNamespace: string,
      resourceRef: V1alpha1ResourceResult,
      container: string
    ) {
      const logs: ApplicationLogEntry[] = [];
      await this.client.getStream<ApplicationLogEntry>(
        `/api/v1/applications/${applicationName}/logs`,
        {
          appNamespace: applicationNamespace,
          namespace: resourceRef.namespace,
          resourceName: resourceRef.name,
          group: resourceRef.group,
          kind: resourceRef.kind,
          version: resourceRef.version,
          follow: false,
          tailLines: 100,
          container: container
        },
        (chunk) => logs.push(chunk)
      );
      return logs;
    }
  • Registers the MCP tool 'get_application_workload_logs' with its description, Zod input schema, and thin handler that delegates to ArgoCDClient.getWorkloadLogs.
    this.addJsonOutputTool(
      'get_application_workload_logs',
      'get_application_workload_logs returns logs for application workload (Deployment, StatefulSet, Pod, etc.) by application name and resource ref and optionally container name',
      {
        applicationName: z.string(),
        applicationNamespace: ApplicationNamespaceSchema,
        resourceRef: ResourceRefSchema,
        container: z.string()
      },
      async ({ applicationName, applicationNamespace, resourceRef, container }) =>
        await this.argocdClient.getWorkloadLogs(
          applicationName,
          applicationNamespace,
          resourceRef as V1alpha1ResourceResult,
          container
        )
    );
  • Zod schema for ResourceRef type used in the tool's input validation.
    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 ApplicationNamespace used in the tool's input validation.
    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.`
      );
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. While it states the tool 'returns logs', it doesn't describe what format the logs are returned in, whether there are pagination limits, time range constraints, or authentication requirements. For a log retrieval tool with zero annotation coverage, this leaves significant behavioral questions unanswered.

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, reasonably concise sentence that gets straight to the point. It's front-loaded with the core purpose. While efficient, the statement about container being 'optionally' contradicts the schema which shows it as required, which is problematic.

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?

For a tool with 4 parameters (including a complex nested object), no annotations, no output schema, and low schema description coverage, the description is inadequate. It doesn't explain the return format, doesn't clarify parameter requirements (contradicts schema on container being optional vs required), and provides no behavioral context about log format, limits, or constraints.

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 only 25% (only applicationNamespace has a description), so the description needs to compensate. The description mentions 'application name and resource ref and optionally container name', which maps to three of the four parameters. However, it doesn't explain the structure of resourceRef (a complex nested object with 6 required fields) or clarify that container is actually required (not optional as stated). The description adds some value but doesn't fully compensate for the low schema coverage.

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: 'returns logs for application workload (Deployment, StatefulSet, Pod, etc.) by application name and resource ref and optionally container name'. It specifies the verb ('returns logs'), resource ('application workload'), and scope ('by application name and resource ref'). However, it doesn't explicitly differentiate from sibling logging tools like get_application_events, which might return different types of events/logs.

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?

The description provides no guidance on when to use this tool versus alternatives. With sibling tools like get_application_events and get_resource_events that might return different types of event data, there's no indication of when this specific log retrieval tool is appropriate versus those alternatives. No prerequisites or constraints are mentioned.

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