Skip to main content
Glama
OctopusDeploy

Octopus Deploy MCP Server

Official

get_deployment_target

Retrieve detailed information about a specific deployment target using its ID and space name to inspect machine configurations and deployment resources.

Instructions

Get a specific deployment target (machine) by ID

This tool retrieves detailed information about a specific deployment target using its ID. The space name and target ID are both required.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
spaceNameYes
targetIdYes

Implementation Reference

  • The asynchronous handler function that creates an Octopus Deploy client, resolves the space ID, fetches the deployment target by ID, maps the response fields, and returns it as a JSON text content block.
    async ({ spaceName, targetId }) => { const configuration = getClientConfigurationFromEnvironment(); const client = await Client.create(configuration); const spaceId = await resolveSpaceId(client, spaceName); const target = await client.get<DeploymentTargetResource>( "~/api/{spaceId}/machines/{id}", { spaceId, id: targetId, } ); const deploymentTarget = { spaceId: target.SpaceId, id: target.Id, name: target.Name, slug: target.Slug, isDisabled: target.IsDisabled, healthStatus: target.HealthStatus, statusSummary: target.StatusSummary, environmentIds: target.EnvironmentIds, roles: target.Roles, tenantedDeploymentParticipation: target.TenantedDeploymentParticipation, tenantIds: target.TenantIds, tenantTags: target.TenantTags, endpoint: { id: target.Endpoint.Id, communicationStyle: target.Endpoint.CommunicationStyle, uri: target.Endpoint.Uri, fingerprint: target.Endpoint.Fingerprint, proxyId: target.Endpoint.ProxyId, tentacleVersionDetails: target.Endpoint.TentacleVersionDetails, }, shellName: target.ShellName, machinePolicyId: target.MachinePolicyId, hasLatestCalamari: target.HasLatestCalamari, isInProcess: target.IsInProcess, links: target.Links, }; return { content: [ { type: "text", text: JSON.stringify(deploymentTarget), }, ], }; }
  • Zod schema defining the input parameters for the tool: spaceName (string) and targetId (string).
    { spaceName: z.string(), targetId: z.string(), },
  • The main registration function that registers the 'get_deployment_target' tool with the MCP server, including name, description, input schema, output metadata, and handler.
    export function registerGetDeploymentTargetTool(server: McpServer) { server.tool( "get_deployment_target", `Get a specific deployment target (machine) by ID This tool retrieves detailed information about a specific deployment target using its ID. The space name and target ID are both required.`, { spaceName: z.string(), targetId: z.string(), }, { title: "Get a specific deployment target from an Octopus Deploy space", readOnlyHint: true, }, async ({ spaceName, targetId }) => { const configuration = getClientConfigurationFromEnvironment(); const client = await Client.create(configuration); const spaceId = await resolveSpaceId(client, spaceName); const target = await client.get<DeploymentTargetResource>( "~/api/{spaceId}/machines/{id}", { spaceId, id: targetId, } ); const deploymentTarget = { spaceId: target.SpaceId, id: target.Id, name: target.Name, slug: target.Slug, isDisabled: target.IsDisabled, healthStatus: target.HealthStatus, statusSummary: target.StatusSummary, environmentIds: target.EnvironmentIds, roles: target.Roles, tenantedDeploymentParticipation: target.TenantedDeploymentParticipation, tenantIds: target.TenantIds, tenantTags: target.TenantTags, endpoint: { id: target.Endpoint.Id, communicationStyle: target.Endpoint.CommunicationStyle, uri: target.Endpoint.Uri, fingerprint: target.Endpoint.Fingerprint, proxyId: target.Endpoint.ProxyId, tentacleVersionDetails: target.Endpoint.TentacleVersionDetails, }, shellName: target.ShellName, machinePolicyId: target.MachinePolicyId, hasLatestCalamari: target.HasLatestCalamari, isInProcess: target.IsInProcess, links: target.Links, }; return { content: [ { type: "text", text: JSON.stringify(deploymentTarget), }, ], }; } ); }
  • Registers the tool in the global TOOL_REGISTRY with its configuration (toolset 'machines', read-only), allowing conditional registration in src/tools/index.ts based on server config.
    registerToolDefinition({ toolName: "get_deployment_target", config: { toolset: "machines", readOnly: true }, registerFn: registerGetDeploymentTargetTool, });

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