Skip to main content
Glama
OctopusDeploy

Octopus Deploy MCP Server

Official

List deployments in an Octopus Deploy space

list_deployments
Read-onlyIdempotent

List deployments in a specified space with filters for projects, environments, tenants, channels, and task state to find specific deployment records.

Instructions

List deployments in a space

This tool lists deployments in a given space. The space name is required. When requesting latest deployment consider which deployment state the user is interested in (successful or all). Optional filters include: projects (array of project IDs), environments (array of environment IDs), tenants (array of tenant IDs), channels (array of channel IDs), taskState (one of: Canceled, Cancelling, Executing, Failed, Queued, Success, TimedOut), and take (number of results to return).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
spaceNameYes
projectsNo
environmentsNo
tenantsNo
channelsNo
taskStateNo
skipNo
takeNo

Implementation Reference

  • The main handler function that registers the 'list_deployments' tool on the MCP server. It accepts filters (spaceName, projects, environments, tenants, channels, taskState, skip, take), queries the Octopus Deploy API via DeploymentRepository.list(), fetches associated release versions and version control references, and returns a formatted JSON response including deployment details and public URLs.
    export function registerListDeploymentsTool(server: McpServer) {
      server.registerTool(
        "list_deployments",
        {
          title: "List deployments in an Octopus Deploy space",
          description: `List deployments in a space
    
      This tool lists deployments in a given space. The space name is required. When requesting latest deployment consider which deployment state the user is interested in (successful or all). Optional filters include: projects (array of project IDs), environments (array of environment IDs), tenants (array of tenant IDs), channels (array of channel IDs), taskState (one of: Canceled, Cancelling, Executing, Failed, Queued, Success, TimedOut), and take (number of results to return).`,
          inputSchema: {
            spaceName: z.string(),
            projects: z.array(z.string()).optional(),
            environments: z.array(z.string()).optional(),
            tenants: z.array(z.string()).optional(),
            channels: z.array(z.string()).optional(),
            taskState: z.enum(["Canceled", "Cancelling", "Executing", "Failed", "Queued", "Success", "TimedOut"]).optional(),
            skip: z.number().optional(),
            take: z.number().optional()
          },
          annotations: READ_ONLY_TOOL_ANNOTATIONS,
        },
        async ({ spaceName, projects, environments, tenants, channels, taskState, skip, take }) => {
          const configuration = getClientConfigurationFromEnvironment();
          const client = await Client.create(configuration);
          const deploymentRepository = new DeploymentRepository(client, spaceName);
    
          const deploymentsResponse = await deploymentRepository.list({
            projects,
            environments,
            tenants,
            channels,
            taskState: taskState ? TaskState[taskState as keyof typeof TaskState] : undefined,
            skip,
            take
          });
    
          const deployments = deploymentsResponse.Items as Deployment[];
          const releaseIds = Array.from(
            new Set(
              deployments
                .map((deployment) => deployment.ReleaseId)
                .filter((releaseId): releaseId is string => Boolean(releaseId))
            )
          );
    
          const releaseVersions = new Map<string, string>();
          const releaseVersionControlReferences = new Map<string, { GitRef?: string; GitCommit?: string }>();
    
          if (releaseIds.length > 0) {
            const releaseRepository = new ReleaseRepository(client, spaceName);
            const releaseResults = await Promise.allSettled(releaseIds.map((id) => releaseRepository.get(id)));
    
            releaseResults.forEach((result, index) => {
              if (result.status === "fulfilled") {
                releaseVersions.set(releaseIds[index]!, result.value.Version);
                if (result.value.VersionControlReference) {
                  releaseVersionControlReferences.set(releaseIds[index]!, result.value.VersionControlReference);
                }
              }
            });
          }
    
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify({
                  totalResults: deploymentsResponse.TotalResults,
                  itemsPerPage: deploymentsResponse.ItemsPerPage,
                  numberOfPages: deploymentsResponse.NumberOfPages,
                  lastPageNumber: deploymentsResponse.LastPageNumber,
                  items: deployments.map((deployment) => {
                    const releaseVersion = deployment.ReleaseId ? releaseVersions.get(deployment.ReleaseId) : undefined;
                    const versionControlReference = deployment.ReleaseId ? releaseVersionControlReferences.get(deployment.ReleaseId) : undefined;
                    const publicUrl = releaseVersion
                      ? getPublicUrl(
                          `${configuration.instanceURL}/app#/{spaceId}/projects/{projectId}/deployments/releases/{releaseVersion}/deployments/{deploymentId}`,
                          {
                            spaceId: deployment.SpaceId,
                            projectId: deployment.ProjectId,
                            releaseVersion,
                            deploymentId: deployment.Id,
                          }
                        )
                      : undefined;
    
                    return {
                      spaceId: deployment.SpaceId,
                      id: deployment.Id,
                      name: deployment.Name,
                      releaseId: deployment.ReleaseId,
                      releaseVersion,
                      versionControlReference,
                      environmentId: deployment.EnvironmentId,
                      tenantId: deployment.TenantId,
                      projectId: deployment.ProjectId,
                      channelId: deployment.ChannelId,
                      created: deployment.Created,
                      taskId: deployment.TaskId,
                      deploymentProcessId: deployment.DeploymentProcessId,
                      comments: deployment.Comments,
                      formValues: deployment.FormValues,
                      queueTime: deployment.QueueTime,
                      queueTimeExpiry: deployment.QueueTimeExpiry,
                      useGuidedFailure: deployment.UseGuidedFailure,
                      specificMachineIds: deployment.SpecificMachineIds,
                      excludedMachineIds: deployment.ExcludedMachineIds,
                      skipActions: deployment.SkipActions,
                      forcePackageDownload: deployment.ForcePackageDownload,
                      forcePackageRedeployment: deployment.ForcePackageRedeployment,
                      publicUrl,
                      publicUrlInstruction: publicUrl
                        ? "You can view more details about this deployment in the Octopus Deploy web portal at the provided publicUrl."
                        : undefined,
                    };
                  })
                }),
              },
            ],
          };
        }
      );
    }
  • Self-registration of the 'list_deployments' tool via registerToolDefinition(), which adds it to the global TOOL_REGISTRY map with toolset 'deployments' and readOnly: true.
    registerToolDefinition({
      toolName: "list_deployments",
      config: { toolset: "deployments", readOnly: true },
      registerFn: registerListDeploymentsTool,
    });
  • Input schema defined using Zod for the list_deployments tool. Parameters: spaceName (required string), projects, environments, tenants, channels (optional arrays of strings), taskState (optional enum), skip and take (optional numbers).
      {
        title: "List deployments in an Octopus Deploy space",
        description: `List deployments in a space
    
    This tool lists deployments in a given space. The space name is required. When requesting latest deployment consider which deployment state the user is interested in (successful or all). Optional filters include: projects (array of project IDs), environments (array of environment IDs), tenants (array of tenant IDs), channels (array of channel IDs), taskState (one of: Canceled, Cancelling, Executing, Failed, Queued, Success, TimedOut), and take (number of results to return).`,
        inputSchema: {
          spaceName: z.string(),
          projects: z.array(z.string()).optional(),
          environments: z.array(z.string()).optional(),
          tenants: z.array(z.string()).optional(),
          channels: z.array(z.string()).optional(),
          taskState: z.enum(["Canceled", "Cancelling", "Executing", "Failed", "Queued", "Success", "TimedOut"]).optional(),
          skip: z.number().optional(),
          take: z.number().optional()
        },
        annotations: READ_ONLY_TOOL_ANNOTATIONS,
  • Import of the listDeployments module in the tools index, which triggers its self-registration when the module is loaded.
    import "./listDeployments.js";
  • The registerToolDefinition() helper function that stores tool registrations in the global TOOL_REGISTRY Map, used by list_deployments for self-registration.
    export function registerToolDefinition(registration: ToolRegistration) {
      TOOL_REGISTRY.set(registration.toolName, registration);
    }
Behavior3/5

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

Annotations already declare readOnlyHint=true and idempotentHint=true, so the description does not need to reiterate safety. It adds useful context about filters and state consideration but does not describe behavior like pagination or sorting, which is relevant for a list tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise with two short paragraphs, front-loading the purpose and then listing filters. Every sentence adds value without redundancy.

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 has 8 parameters and no output schema, the description covers most filters but misses skip/pagination details and does not describe the return format (e.g., array of deployments). Annotations compensate for safety but not for completeness of output.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description must explain parameters. It describes the required spaceName and most optional filters (projects, environments, tenants, channels, taskState, take) with clear purpose. However, it omits the skip parameter, which is present in the schema but not addressed.

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 tool lists deployments in an Octopus Deploy space, specifying the required space name and optional filters. It distinguishes itself from sibling tools like deploy_release or get_deployment_from_url by focusing on listing deployments.

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 advises considering deployment state for latest deployments, but it does not explicitly state when to use this tool over alternatives like get_deployment_from_url for specific deployments, nor does it mention scenarios to avoid using it.

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