Skip to main content
Glama
OctopusDeploy

Octopus Deploy MCP Server

Official

get_tenant_variables

Retrieve tenant variables from Octopus Deploy by type: all, common, or project-specific variables for deployment configuration.

Instructions

Get tenant variables by type

This tool retrieves different types of tenant variables. Use variableType parameter to specify which type:

  • "all": Get all tenant variables

  • "common": Get common variables only

  • "project": Get project-specific variables only

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
spaceNameYesThe space name
tenantIdYesThe ID of the tenant to retrieve variables for
variableTypeYesType of variables to retrieve
includeMissingVariablesNoInclude missing variables in the response (for common/project types)

Implementation Reference

  • Handler function that connects to Octopus Deploy client, fetches tenant repository, and retrieves variables based on variableType ('all', 'common', or 'project'), optionally including missing variables.
    async ({ spaceName, tenantId, variableType, includeMissingVariables = false }) => { const configuration = getClientConfigurationFromEnvironment(); const client = await Client.create(configuration); const tenantRepository = new TenantRepository(client, spaceName); let variables; switch (variableType) { case "all": { const tenant = await tenantRepository.get(tenantId); variables = await tenantRepository.getVariables(tenant); break; } case "common": variables = await tenantRepository.getCommonVariablesById(tenantId, includeMissingVariables); break; case "project": variables = await tenantRepository.getProjectVariablesById(tenantId, includeMissingVariables); break; } return { content: [ { type: "text", text: JSON.stringify({ tenantId, variableType, includeMissingVariables, variables }), }, ], }; }
  • Zod input schema defining parameters: spaceName (string), tenantId (string), variableType (enum: all/common/project), includeMissingVariables (optional boolean).
    { spaceName: z.string().describe("The space name"), tenantId: z.string().describe("The ID of the tenant to retrieve variables for"), variableType: z.enum(["all", "common", "project"]).describe("Type of variables to retrieve"), includeMissingVariables: z.boolean().optional().describe("Include missing variables in the response (for common/project types)") },
  • Main registration function registerGetTenantVariablesTool that calls server.tool() to register the tool with name, description, input schema, output metadata, and handler.
    export function registerGetTenantVariablesTool(server: McpServer) { server.tool( "get_tenant_variables", `Get tenant variables by type This tool retrieves different types of tenant variables. Use variableType parameter to specify which type: - "all": Get all tenant variables - "common": Get common variables only - "project": Get project-specific variables only`, { spaceName: z.string().describe("The space name"), tenantId: z.string().describe("The ID of the tenant to retrieve variables for"), variableType: z.enum(["all", "common", "project"]).describe("Type of variables to retrieve"), includeMissingVariables: z.boolean().optional().describe("Include missing variables in the response (for common/project types)") }, { title: "Get tenant variables from Octopus Deploy", readOnlyHint: true, }, async ({ spaceName, tenantId, variableType, includeMissingVariables = false }) => { const configuration = getClientConfigurationFromEnvironment(); const client = await Client.create(configuration); const tenantRepository = new TenantRepository(client, spaceName); let variables; switch (variableType) { case "all": { const tenant = await tenantRepository.get(tenantId); variables = await tenantRepository.getVariables(tenant); break; } case "common": variables = await tenantRepository.getCommonVariablesById(tenantId, includeMissingVariables); break; case "project": variables = await tenantRepository.getProjectVariablesById(tenantId, includeMissingVariables); break; } return { content: [ { type: "text", text: JSON.stringify({ tenantId, variableType, includeMissingVariables, variables }), }, ], }; } ); }
  • Calls registerToolDefinition to add the tool to TOOL_REGISTRY with metadata (toolName, config: toolset 'tenants', readOnly true), linking to the register function.
    registerToolDefinition({ toolName: "get_tenant_variables", config: { toolset: "tenants", readOnly: true }, registerFn: registerGetTenantVariablesTool, });

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