Skip to main content
Glama
OctopusDeploy

Octopus Deploy MCP Server

Official

list_deployments

Read-only

Retrieve deployment records from Octopus Deploy by specifying a space, with optional filters for projects, environments, tenants, channels, and task states to focus on relevant DevOps activities.

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 asynchronous handler function that executes the tool logic: connects to Octopus Deploy client, queries deployments with filters, and returns JSON-formatted results.
      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
        });
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify({
                totalResults: deploymentsResponse.TotalResults,
                itemsPerPage: deploymentsResponse.ItemsPerPage,
                numberOfPages: deploymentsResponse.NumberOfPages,
                lastPageNumber: deploymentsResponse.LastPageNumber,
                items: deploymentsResponse.Items.map((deployment: Deployment) => ({
                  spaceId: deployment.SpaceId,
                  id: deployment.Id,
                  name: deployment.Name,
                  releaseId: deployment.ReleaseId,
                  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,
                }))
              }),
            },
          ],
        };
      }
    );
  • Zod schema defining the input parameters for the list_deployments tool, including required spaceName and optional filters.
      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()
    },
  • The registerListDeploymentsTool function called by the server to register the 'list_deployments' tool with name, description, schema, metadata, and inline handler.
    export function registerListDeploymentsTool(server: McpServer) {
      server.tool(
        "list_deployments",
        `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).`,
        {
          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()
        },
        {
          title: "List deployments in an Octopus Deploy space",
          readOnlyHint: true,
        },
        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
          });
    
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify({
                  totalResults: deploymentsResponse.TotalResults,
                  itemsPerPage: deploymentsResponse.ItemsPerPage,
                  numberOfPages: deploymentsResponse.NumberOfPages,
                  lastPageNumber: deploymentsResponse.LastPageNumber,
                  items: deploymentsResponse.Items.map((deployment: Deployment) => ({
                    spaceId: deployment.SpaceId,
                    id: deployment.Id,
                    name: deployment.Name,
                    releaseId: deployment.ReleaseId,
                    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,
                  }))
                }),
              },
            ],
          };
        }
      );
    }
  • Self-registration of the tool into the TOOL_REGISTRY, specifying toolset and readOnly config, linking to the register function.
    registerToolDefinition({
      toolName: "list_deployments",
      config: { toolset: "deployments", readOnly: true },
      registerFn: registerListDeploymentsTool,
    });
  • Import statement in tools index that triggers the side-effect registration of listDeployments tool via registerToolDefinition.
    import "./listDeployments.js";
Behavior3/5

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

Annotations provide readOnlyHint=true, indicating a safe read operation. The description adds useful context about filtering options and the 'latest deployment' consideration, which goes beyond the annotations. However, it doesn't disclose behavioral traits like pagination behavior (implied by 'skip' and 'take' parameters but not explained), rate limits, or authentication needs, leaving some gaps.

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 appropriately sized and front-loaded, starting with the core purpose. The second sentence elaborates on parameters efficiently. While concise, the mention of 'latest deployment' could be more integrated, and the structure is slightly fragmented, but overall it avoids unnecessary verbosity.

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 8 parameters, 0% schema coverage, no output schema, and annotations only covering read-only status, the description does a decent job explaining parameters and usage. However, it lacks details on return values (e.g., deployment structure), error handling, or pagination mechanics, making it incomplete for optimal agent use without additional context.

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 compensates well by explaining the purpose of most parameters: 'spaceName' is required, and optional filters include 'projects,' 'environments,' 'tenants,' 'channels,' 'taskState,' and 'take.' It clarifies that 'taskState' has specific enum values and 'take' controls result count. However, it omits 'skip' (implied for pagination but not described), preventing a perfect score.

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: 'List deployments in a space' and 'lists deployments in a given space.' It specifies the verb ('list') and resource ('deployments') with scope ('in a space'). However, it doesn't explicitly differentiate from sibling tools like 'list_releases' or 'list_deployment_targets,' which prevents a perfect score.

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 provides some implied usage context by mentioning 'When requesting latest deployment consider which deployment state the user is interested in,' which suggests this tool might be used for retrieving recent deployments. However, it lacks explicit guidance on when to use this tool versus alternatives like 'list_releases' or 'get_deployment_process,' and doesn't specify prerequisites or exclusions.

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