Skip to main content
Glama
OctopusDeploy

Octopus Deploy MCP Server

Official

get_tenant_by_id

Retrieve tenant details by ID to view associated projects and environments for managing customer-specific deployments in Octopus Deploy.

Instructions

Get details for a specific tenant by its ID, including the projects and environments the tenant is associated with. Tenants represent customers or clients in Octopus Deploy, allowing you to manage deployments and configurations specific to each tenant. Tenants can be grouped into tenant tags for easier management and deployment targeting. Tenants can also represent geographical locations, organizational units, or any other logical grouping.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
spaceNameYesThe space name
tenantIdYesThe ID of the tenant to retrieve

Implementation Reference

  • The async handler function that creates an Octopus Deploy client, resolves the space ID, fetches the tenant resource by ID, formats key details into JSON, generates a public URL, and returns it as tool content.
    async ({spaceName, tenantId}) => { const configuration = getClientConfigurationFromEnvironment(); const client = await Client.create(configuration); const spaceId = await resolveSpaceId(client, spaceName); const tenant = await client.get<TenantResource>("~/api/{spaceId}/tenant/{tenantId}", {spaceId, tenantId}); return { content: [ { type: "text", text: JSON.stringify({ id: tenant.Id, name: tenant.Name, slug: tenant.Slug, description: tenant.Description, isDisabled: tenant.IsDisabled, projectEnvironments: tenant.ProjectEnvironments, tenantTags: tenant.TenantTags, clonedFromTenantId: tenant.ClonedFromTenantId, spaceId: tenant.SpaceId, publicUrl: getPublicUrl(`${configuration.instanceURL}/app#/{spaceId}/tenants/{tenantId}/overview`, { spaceId: tenant.SpaceId, tenantId: tenant.Id }), publicUrlInstruction: `You can view more details about this tenant in the Octopus Deploy web portal at the provided publicUrl.` }), }, ], }; }
  • Input schema defined using Zod, specifying spaceName and tenantId as required string parameters with descriptions.
    { spaceName: z.string().describe("The space name"), tenantId: z.string().describe("The ID of the tenant to retrieve") },
  • The registerGetTenantByIdTool function called to register the tool on the MCP server, specifying name, description, input schema, output metadata, and handler.
    export function registerGetTenantByIdTool(server: McpServer) { server.tool( "get_tenant_by_id", `Get details for a specific tenant by its ID, including the projects and environments the tenant is associated with. ${tenantsDescription}`, { spaceName: z.string().describe("The space name"), tenantId: z.string().describe("The ID of the tenant to retrieve") }, { title: "Get tenant details by ID from Octopus Deploy", readOnlyHint: true, }, async ({spaceName, tenantId}) => { const configuration = getClientConfigurationFromEnvironment(); const client = await Client.create(configuration); const spaceId = await resolveSpaceId(client, spaceName); const tenant = await client.get<TenantResource>("~/api/{spaceId}/tenant/{tenantId}", {spaceId, tenantId}); return { content: [ { type: "text", text: JSON.stringify({ id: tenant.Id, name: tenant.Name, slug: tenant.Slug, description: tenant.Description, isDisabled: tenant.IsDisabled, projectEnvironments: tenant.ProjectEnvironments, tenantTags: tenant.TenantTags, clonedFromTenantId: tenant.ClonedFromTenantId, spaceId: tenant.SpaceId, publicUrl: getPublicUrl(`${configuration.instanceURL}/app#/{spaceId}/tenants/{tenantId}/overview`, { spaceId: tenant.SpaceId, tenantId: tenant.Id }), publicUrlInstruction: `You can view more details about this tenant in the Octopus Deploy web portal at the provided publicUrl.` }), }, ], }; } ); }
  • Self-registration of the tool definition into the TOOL_REGISTRY, which is used by index.ts to conditionally register enabled tools.
    registerToolDefinition({ toolName: "get_tenant_by_id", config: {toolset: "tenants", readOnly: true}, registerFn: registerGetTenantByIdTool, });

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