Skip to main content
Glama
OctopusDeploy

Octopus Deploy MCP Server

Official

Get Kubernetes live status from Octopus Deploy

get_kubernetes_live_status
Read-onlyIdempotent

Retrieve live Kubernetes resource status for a project and environment. Optionally include a tenant ID for 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 main handler function that registers the 'get_kubernetes_live_status' tool with the MCP server. Validates entity IDs (project, environment, tenant), creates an Octopus API client, calls observabilityRepository.getLiveStatus() to fetch Kubernetes live status data, formats the response with machine statuses and resources, and handles errors (including a version check for Octopus 2025.3+).
    export function registerGetKubernetesLiveStatusTool(server: McpServer) {
      server.registerTool(
        "get_kubernetes_live_status",
        {
          title: "Get Kubernetes live status from Octopus Deploy",
          description: `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.`,
          inputSchema: {
            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")
          },
          annotations: READ_ONLY_TOOL_ANNOTATIONS,
        },
        async ({ spaceName, projectId, environmentId, tenantId, summaryOnly = false }) => {
          validateEntityId(projectId, 'project', ENTITY_PREFIXES.project);
          validateEntityId(environmentId, 'environment', ENTITY_PREFIXES.environment);
          if (tenantId) {
            validateEntityId(tenantId, 'tenant', ENTITY_PREFIXES.tenant);
          }
    
          try {
            const configuration = getClientConfigurationFromEnvironment();
            const client = await Client.create(configuration);
            const observabilityRepository = new ObservabilityRepository(client, spaceName);
    
            const liveStatus = await observabilityRepository.getLiveStatus(
              projectId,
              environmentId,
              tenantId,
              summaryOnly
            );
    
            if (!liveStatus || (!liveStatus.MachineStatuses && !liveStatus.Summary)) {
              throw new Error(
                `No Kubernetes live status found for project '${projectId}' in environment '${environmentId}'${tenantId ? ` for tenant '${tenantId}'` : ''}. ` +
                "This may indicate that the project is not deployed to Kubernetes in this environment, or the resources are not being monitored."
              );
            }
    
            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
                    }
                  }),
                },
              ],
            };
          } catch (error) {
            if (isErrorWithMessage(error, 'minimum version')) {
              throw new Error(
                `Kubernetes live status requires Octopus Deploy version 2025.3 or later. ` +
                "This feature is not available in your Octopus Deploy instance version."
              );
            }
            handleOctopusApiError(error, { spaceName });
          }
        }
      );
    }
  • Input schema using Zod validation: requires spaceName (string), projectId (string), environmentId (string), with optional tenantId (string) and summaryOnly (boolean).
      inputSchema: {
        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")
      },
      annotations: READ_ONLY_TOOL_ANNOTATIONS,
    },
  • Registers the tool in the global TOOL_REGISTRY with toolset 'kubernetes', read-only mode, and a minimum Octopus Deploy version requirement of 2025.3.
    registerToolDefinition({
      toolName: "get_kubernetes_live_status",
      config: { toolset: "kubernetes", readOnly: true },
      registerFn: registerGetKubernetesLiveStatusTool,
      minimumOctopusVersion: "2025.3",
    });
  • Imports the tool module in src/tools/index.ts so that the self-registration call (registerToolDefinition) is executed when tools are loaded.
    import "./getKubernetesLiveStatus.js";
  • Helper that reads Octopus Deploy server configuration from environment variables (OCTOPUS_SERVER_URL, OCTOPUS_API_KEY, OCTOPUS_ACCESS_TOKEN) to create the API client configuration used by the tool.
    export function getClientConfigurationFromEnvironment(): ClientConfiguration {
      return getClientConfiguration({
        instanceURL: env["CLI_SERVER_URL"] || env["OCTOPUS_SERVER_URL"],
        apiKey: env["OCTOPUS_API_KEY"],
        accessToken: env["OCTOPUS_ACCESS_TOKEN"],
      });
    }
Behavior3/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, idempotentHint=true, so the description's claim of 'retrieves' is consistent and adds no contradictory behavior. However, it does not disclose any additional behavioral traits beyond what annotations provide, such as rate limits or side effects.

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 two concise sentences with the key information front-loaded. It could be slightly more efficient by combining sentences, but it avoids unnecessary fluff and is easy to parse.

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 tool retrieves data and lacks an output schema, the description should clarify what 'live status' includes (e.g., format, fields, pagination). It does not, leaving the agent uncertain about the return value. This is a significant gap for a query tool.

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%, so the baseline is 3. The description adds minimal value beyond the schema: it mentions 'Optionally include a tenant ID' but the schema already describes that parameter. No additional meanings or constraints are added.

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

Purpose5/5

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

The description clearly states the verb 'Get' and the resource 'Kubernetes live status for a project and environment'. It distinguishes itself from sibling tools, none of which mention Kubernetes, making its purpose specific and unique.

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 (to retrieve live status) but provides no explicit guidance on when to use it vs alternatives or when not to use it. There are no other similar sibling tools, so the lack of alternatives is acceptable, but explicit context would improve scoring.

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