Skip to main content
Glama
OctopusDeploy

Octopus Deploy MCP Server

Official

get_tenant_variables

Read-only

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,
    });
Behavior3/5

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

Annotations already declare readOnlyHint=true, so the agent knows this is a safe read operation. The description adds useful context about filtering by variable type, but doesn't disclose additional behavioral traits like pagination, rate limits, authentication needs, or what 'missing variables' means in the response. With annotations covering safety, a 3 is appropriate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is perfectly structured: a clear purpose statement followed by bullet points explaining parameter options. Every sentence earns its place with zero wasted words. It's front-loaded with the main functionality.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a read-only tool with good annotations and full schema coverage, the description is mostly complete. However, without an output schema, it doesn't explain what the response contains (e.g., variable values, formats, structure). The mention of 'missing variables' in the parameter description creates some ambiguity about response content.

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 100%, so parameters are already documented in the schema. The description adds marginal value by explaining the meaning of variableType enum values (all/common/project), but doesn't provide additional semantics beyond what's in the schema. Baseline 3 is correct when schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'retrieves' and resource 'tenant variables', with specific differentiation from sibling tools like 'get_variables' (general variables) and 'get_missing_tenant_variables' (only missing ones). It precisely defines what this tool does: get tenant variables filtered by type.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use this tool by explaining the variableType parameter options (all/common/project). However, it doesn't explicitly state when NOT to use it or mention alternatives like 'get_missing_tenant_variables' for missing variables specifically.

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