Skip to main content
Glama
OctopusDeploy

Octopus Deploy MCP Server

Official

get_kubernetes_live_status

Read-only

Retrieve real-time Kubernetes resource status for Octopus Deploy projects and environments, including multi-tenant deployments.

Instructions

Get Kubernetes live status for a project and environment

This tool retrieves the live status of Kubernetes resources for a specific project and environment. Optionally include a tenant ID for multi-tenant deployments.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
spaceNameYesThe space name
projectIdYesThe ID of the project
environmentIdYesThe ID of the environment
tenantIdNoThe ID of the tenant (for multi-tenant deployments)
summaryOnlyNoReturn summary information only

Implementation Reference

  • The handler function that executes the tool logic: connects to Octopus Deploy, fetches Kubernetes live status via ObservabilityRepository, and returns formatted JSON.
    async ({ spaceName, projectId, environmentId, tenantId, summaryOnly = false }) => {
      const configuration = getClientConfigurationFromEnvironment();
      const client = await Client.create(configuration);
      const observabilityRepository = new ObservabilityRepository(client, spaceName);
    
      const liveStatus = await observabilityRepository.getLiveStatus(
        projectId,
        environmentId,
        tenantId,
        summaryOnly
      );
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify({
              projectId,
              environmentId,
              tenantId,
              summaryOnly: summaryOnly,
              liveStatus: {
                machineStatuses: liveStatus.MachineStatuses?.map((machine: KubernetesMachineLiveStatusResource) => ({
                  machineId: machine.MachineId,
                  status: machine.Status,
                  resources: machine.Resources?.map((resource: KubernetesLiveStatusResource) => ({
                    name: resource.Name,
                    namespace: resource.Namespace,
                    kind: resource.Kind,
                    healthStatus: resource.HealthStatus,
                    syncStatus: resource.SyncStatus,
                    machineId: resource.MachineId,
                    children: resource.Children,
                    desiredResourceId: resource.DesiredResourceId,
                    resourceId: resource.ResourceId
                  }))
                })),
                summary: liveStatus.Summary ? {
                  status: liveStatus.Summary.Status,
                  lastUpdated: liveStatus.Summary.LastUpdated
                } : undefined
              }
            }),
          },
        ],
      };
    }
  • Zod schema defining the input parameters for the tool.
      spaceName: z.string().describe("The space name"),
      projectId: z.string().describe("The ID of the project"),
      environmentId: z.string().describe("The ID of the environment"),
      tenantId: z.string().optional().describe("The ID of the tenant (for multi-tenant deployments)"),
      summaryOnly: z.boolean().optional().describe("Return summary information only")
    },
  • Function that registers the tool with the MCP server, including name, description, input schema, output metadata, and handler.
    export function registerGetKubernetesLiveStatusTool(server: McpServer) {
      server.tool(
        "get_kubernetes_live_status",
        `Get Kubernetes live status for a project and environment
      
      This tool retrieves the live status of Kubernetes resources for a specific project and environment. Optionally include a tenant ID for multi-tenant deployments.`,
        { 
          spaceName: z.string().describe("The space name"),
          projectId: z.string().describe("The ID of the project"),
          environmentId: z.string().describe("The ID of the environment"),
          tenantId: z.string().optional().describe("The ID of the tenant (for multi-tenant deployments)"),
          summaryOnly: z.boolean().optional().describe("Return summary information only")
        },
        {
          title: "Get Kubernetes live status from Octopus Deploy",
          readOnlyHint: true,
        },
        async ({ spaceName, projectId, environmentId, tenantId, summaryOnly = false }) => {
          const configuration = getClientConfigurationFromEnvironment();
          const client = await Client.create(configuration);
          const observabilityRepository = new ObservabilityRepository(client, spaceName);
    
          const liveStatus = await observabilityRepository.getLiveStatus(
            projectId,
            environmentId,
            tenantId,
            summaryOnly
          );
    
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify({
                  projectId,
                  environmentId,
                  tenantId,
                  summaryOnly: summaryOnly,
                  liveStatus: {
                    machineStatuses: liveStatus.MachineStatuses?.map((machine: KubernetesMachineLiveStatusResource) => ({
                      machineId: machine.MachineId,
                      status: machine.Status,
                      resources: machine.Resources?.map((resource: KubernetesLiveStatusResource) => ({
                        name: resource.Name,
                        namespace: resource.Namespace,
                        kind: resource.Kind,
                        healthStatus: resource.HealthStatus,
                        syncStatus: resource.SyncStatus,
                        machineId: resource.MachineId,
                        children: resource.Children,
                        desiredResourceId: resource.DesiredResourceId,
                        resourceId: resource.ResourceId
                      }))
                    })),
                    summary: liveStatus.Summary ? {
                      status: liveStatus.Summary.Status,
                      lastUpdated: liveStatus.Summary.LastUpdated
                    } : undefined
                  }
                }),
              },
            ],
          };
        }
      );
    }
  • Registers the tool in the global TOOL_REGISTRY for conditional enabling based on config.
    registerToolDefinition({
      toolName: "get_kubernetes_live_status",
      config: { toolset: "kubernetes", readOnly: true },
      registerFn: registerGetKubernetesLiveStatusTool,
      minimumOctopusVersion: "2025.3",
    });
Behavior3/5

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

Annotations provide readOnlyHint=true, indicating this is a safe read operation. The description adds context about retrieving 'live status' and mentions multi-tenant deployments, which offers some behavioral insight beyond annotations. However, it doesn't disclose details like rate limits, authentication needs, or what 'live status' entails (e.g., real-time vs. cached data), missing opportunities for richer context given the lack of output schema.

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: the first states the core purpose, and the second adds optional parameter context. It's front-loaded with the main action and avoids redundancy. However, the second sentence could be integrated more smoothly, and there's slight room for tighter phrasing without losing clarity.

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?

Given the tool's moderate complexity (5 parameters, no output schema) and annotations covering safety, the description is adequate but incomplete. It explains what the tool does but lacks details on return values (critical without output schema), error conditions, or prerequisites. For a Kubernetes status tool, more context on output structure or limitations would enhance completeness.

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 100%, with all parameters well-documented in the schema (e.g., 'spaceName' as 'The space name'). The description adds minimal semantic value beyond the schema by mentioning 'project and environment' and 'tenant ID for multi-tenant deployments,' but doesn't explain parameter interactions or provide additional context like format examples. This meets the baseline for high 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: 'retrieves the live status of Kubernetes resources for a specific project and environment.' It specifies the verb ('retrieves'), resource ('live status of Kubernetes resources'), and scope ('for a specific project and environment'). However, it doesn't explicitly differentiate from sibling tools like 'get_deployment_target' or 'list_deployment_targets' which might also provide Kubernetes-related information.

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 context by specifying 'for a specific project and environment' and mentions optional tenant ID 'for multi-tenant deployments,' which gives some situational guidance. However, it doesn't explicitly state when to use this tool versus alternatives (e.g., vs. 'get_deployment_target' for target status) or provide exclusions, leaving usage somewhat ambiguous relative to siblings.

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/OctopusDeploy/mcp-server'

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