Skip to main content
Glama
OctopusDeploy

Octopus Deploy MCP Server

Official

get_deployment_process

Read-only

Retrieve deployment process details by ID to view project workflows, frozen release processes, or branch-specific configurations in Octopus Deploy.

Instructions

Get deployment process by ID

This tool retrieves a deployment process by its ID. Each project has a deployment process attached, and releases/deployments can also have frozen processes attached.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
spaceNameYes
projectIdNoThe ID of the project to retrieve the deployment process for. If processId is not provided, this parameter is required.
processIdNoThe ID of the deployment process to retrieve. If not provided, the deployment process for the project will be retrieved.
branchNameNoOptional branch name to get the deployment process for a specific branch (if using version controlled projects). Try `main` or `master` if unsure.
includeDetailsNoInclude detailed properties for steps and actions. Defaults to false.

Implementation Reference

  • The main handler function that executes the logic to fetch the deployment process from Octopus Deploy using the Octopus API client. It handles parameters like spaceName, projectId, processId, branchName, and includeDetails, resolves the process ID if needed, fetches project branches if version-controlled, constructs the API URL, retrieves the data, maps the steps and actions, and returns the formatted response.
    async ({ spaceName, processId, projectId, branchName, includeDetails = false }) => {
    
      if (!processId && !projectId) {
        throw new Error("Either processId or projectId must be provided.");
      }
    
      const configuration = getClientConfigurationFromEnvironment();
      const client = await Client.create(configuration);
      const spaceId = await resolveSpaceId(client, spaceName);
      const projectRepository = projectId ? new ProjectRepository(client, spaceName) : null;
      const project = projectRepository && projectId ? await projectRepository.get(projectId) : null;
    
      // If we were not supplied a processId, we assume we are retrieving the process for the specified project.
      if (!processId) {
        processId = project?.DeploymentProcessId;
      }
    
      if (project?.IsVersionControlled && !branchName) {
        throw new Error("Branch name must be provided for version controlled projects.");
      }
    
      // If using branchName get the canonical ref first
      const branches = branchName && projectId && await getProjectBranches(client, spaceId, projectId, { take: 1, searchByName: branchName });
      const gitRef = branches && branches.Items.length > 0 ? branches.Items[0].CanonicalName : undefined;
    
      const url = gitRef
        ? `~/api/{spaceId}/projects/{projectId}/{gitRef}/deploymentprocesses`
        : `~/api/{spaceId}/deploymentprocesses/{processId}`;
    
      const response = await client.get<DeploymentProcessResource>(
        url,
        {
          spaceId,
          projectId,
          processId,
          gitRef
        }
      );
    
      const deploymentProcess = {
        spaceId: response.SpaceId,
        id: response.Id,
        projectId: response.ProjectId,
        version: response.Version,
        lastSnapshotId: response.LastSnapshotId,
        steps: response.Steps.map((step) => {
          const mappedStep = {
            id: step.Id,
            name: step.Name,
            condition: step.Condition,
            startTrigger: step.StartTrigger,
            packageRequirement: step.PackageRequirement,
            ...(includeDetails && { properties: step.Properties }),
            actions: step.Actions.map((action) => {
              if (includeDetails) {
                return action;
              } else {
                // eslint-disable-next-line @typescript-eslint/no-unused-vars
                const { Properties, ...actionWithoutProperties } = action;
                return actionWithoutProperties;
              }
            }),
          };
          
          return mappedStep;
        }),
      };
    
      return {
        content: [
          {
            type: "text",
            text: `Retrieved deployment process with ID '${deploymentProcess.id}' in space '${spaceName}'${branchName ? ` for branch '${branchName}'` : ""}.`,
          },
          {
            type: "text",
            text: JSON.stringify(deploymentProcess),
          },
        ],
      };
    }
  • Zod input schema defining the parameters for the get_deployment_process tool: spaceName (required), projectId (optional), processId (optional), branchName (optional), includeDetails (optional boolean).
      spaceName: z.string(),
      projectId: z.string().optional().describe("The ID of the project to retrieve the deployment process for. If processId is not provided, this parameter is required."),
      processId: z.string().optional().describe("The ID of the deployment process to retrieve. If not provided, the deployment process for the project will be retrieved."),
      branchName: z.string().optional().describe("Optional branch name to get the deployment process for a specific branch (if using version controlled projects). Try `main` or `master` if unsure."),
      includeDetails: z.boolean().optional().default(false).describe("Include detailed properties for steps and actions. Defaults to false."),
    },
  • The registration function that sets up the 'get_deployment_process' tool on the MCP server, including name, description, input schema, output hints, and handler.
    export function registerGetDeploymentProcessTool(server: McpServer) {
      server.tool(
        "get_deployment_process",
        `Get deployment process by ID
    
    This tool retrieves a deployment process by its ID. Each project has a deployment process attached, and releases/deployments can also have frozen processes attached.`,
        {
          spaceName: z.string(),
          projectId: z.string().optional().describe("The ID of the project to retrieve the deployment process for. If processId is not provided, this parameter is required."),
          processId: z.string().optional().describe("The ID of the deployment process to retrieve. If not provided, the deployment process for the project will be retrieved."),
          branchName: z.string().optional().describe("Optional branch name to get the deployment process for a specific branch (if using version controlled projects). Try `main` or `master` if unsure."),
          includeDetails: z.boolean().optional().default(false).describe("Include detailed properties for steps and actions. Defaults to false."),
        },
        {
          title: "Get deployment process details from Octopus Deploy",
          readOnlyHint: true,
        },
        async ({ spaceName, processId, projectId, branchName, includeDetails = false }) => {
    
          if (!processId && !projectId) {
            throw new Error("Either processId or projectId must be provided.");
          }
    
          const configuration = getClientConfigurationFromEnvironment();
          const client = await Client.create(configuration);
          const spaceId = await resolveSpaceId(client, spaceName);
          const projectRepository = projectId ? new ProjectRepository(client, spaceName) : null;
          const project = projectRepository && projectId ? await projectRepository.get(projectId) : null;
    
          // If we were not supplied a processId, we assume we are retrieving the process for the specified project.
          if (!processId) {
            processId = project?.DeploymentProcessId;
          }
    
          if (project?.IsVersionControlled && !branchName) {
            throw new Error("Branch name must be provided for version controlled projects.");
          }
    
          // If using branchName get the canonical ref first
          const branches = branchName && projectId && await getProjectBranches(client, spaceId, projectId, { take: 1, searchByName: branchName });
          const gitRef = branches && branches.Items.length > 0 ? branches.Items[0].CanonicalName : undefined;
    
          const url = gitRef
            ? `~/api/{spaceId}/projects/{projectId}/{gitRef}/deploymentprocesses`
            : `~/api/{spaceId}/deploymentprocesses/{processId}`;
    
          const response = await client.get<DeploymentProcessResource>(
            url,
            {
              spaceId,
              projectId,
              processId,
              gitRef
            }
          );
    
          const deploymentProcess = {
            spaceId: response.SpaceId,
            id: response.Id,
            projectId: response.ProjectId,
            version: response.Version,
            lastSnapshotId: response.LastSnapshotId,
            steps: response.Steps.map((step) => {
              const mappedStep = {
                id: step.Id,
                name: step.Name,
                condition: step.Condition,
                startTrigger: step.StartTrigger,
                packageRequirement: step.PackageRequirement,
                ...(includeDetails && { properties: step.Properties }),
                actions: step.Actions.map((action) => {
                  if (includeDetails) {
                    return action;
                  } else {
                    // eslint-disable-next-line @typescript-eslint/no-unused-vars
                    const { Properties, ...actionWithoutProperties } = action;
                    return actionWithoutProperties;
                  }
                }),
              };
              
              return mappedStep;
            }),
          };
    
          return {
            content: [
              {
                type: "text",
                text: `Retrieved deployment process with ID '${deploymentProcess.id}' in space '${spaceName}'${branchName ? ` for branch '${branchName}'` : ""}.`,
              },
              {
                type: "text",
                text: JSON.stringify(deploymentProcess),
              },
            ],
          };
        }
      );
    }
  • Self-registration of the tool definition into the TOOL_REGISTRY, specifying toolset 'projects' and read-only, linking to the register function.
    registerToolDefinition({
      toolName: "get_deployment_process",
      config: { toolset: "projects", readOnly: true },
      registerFn: registerGetDeploymentProcessTool,
    });
  • Import that triggers the self-registration of the getDeploymentProcess tool.
    import './getDeploymentProcess.js';
Behavior4/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 valuable context beyond this: it explains that deployment processes can be attached to projects or releases (including 'frozen processes'), clarifying the tool's scope and relationships. This enhances understanding without contradicting annotations, though it doesn't detail rate limits or auth needs.

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 front-loaded with the core purpose in the first sentence, followed by clarifying context. It's efficient with two sentences and no redundant information, though it could be slightly more structured (e.g., bullet points for key points) for optimal readability.

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), the description covers the basic purpose and context but lacks details on return values or error handling. With annotations providing safety info and schema covering most parameters, it's adequate but not fully comprehensive for an agent to handle all edge cases.

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 80%, providing good documentation for parameters like projectId, processId, and branchName. The description doesn't add significant semantic details beyond the schema (e.g., no extra syntax or format explanations), so it meets the baseline of 3 where the schema handles most of the parameter documentation.

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 a deployment process by its ID' (verb+resource). It distinguishes deployment processes from other entities like releases/deployments by mentioning 'frozen processes attached,' but doesn't explicitly differentiate from sibling tools like get_release_by_id or get_task_by_id, which retrieve different resources.

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 by stating 'Each project has a deployment process attached,' suggesting it's for retrieving processes linked to projects or releases. However, it doesn't provide explicit guidance on when to use this tool versus alternatives (e.g., no mention of sibling tools like list_deployments or get_task_details for related data), leaving context somewhat open-ended.

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