get_missing_tenant_variables
Identify tenant variables with missing values in Octopus Deploy. Filter by tenant, project, or environment to locate configuration gaps.
Instructions
Get missing tenant variables
This tool retrieves tenant variables that are missing values. Optionally filter by tenant, project, or environment.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| spaceName | Yes | The space name | |
| tenantId | No | Filter by specific tenant ID | |
| projectId | No | Filter by specific project ID | |
| environmentId | No | Filter by specific environment ID | |
| includeDetails | No | Include detailed information about missing variables |
Implementation Reference
- The handler function that implements the core logic of the 'get_missing_tenant_variables' tool. It creates an Octopus Deploy client, fetches missing tenant variables using TenantRepository, and returns the results as JSON in markdown content.async ({ spaceName, tenantId, projectId, environmentId, includeDetails = false }) => { const configuration = getClientConfigurationFromEnvironment(); const client = await Client.create(configuration); const tenantRepository = new TenantRepository(client, spaceName); const filterOptions = { tenantId, projectId, environmentId }; const missingVariables = await tenantRepository.missingVariables(filterOptions, includeDetails); return { content: [ { type: "text", text: JSON.stringify({ filters: filterOptions, includeDetails, missingVariables }), }, ], }; }
- Zod schema defining the input parameters for the tool, including required spaceName and optional filters.{ spaceName: z.string().describe("The space name"), tenantId: z.string().optional().describe("Filter by specific tenant ID"), projectId: z.string().optional().describe("Filter by specific project ID"), environmentId: z.string().optional().describe("Filter by specific environment ID"), includeDetails: z.boolean().optional().describe("Include detailed information about missing variables") },
- src/tools/getMissingTenantVariables.ts:53-57 (registration)Registers the tool in the TOOL_REGISTRY, specifying its name, toolset, read-only status, and the function to register it on the MCP server.registerToolDefinition({ toolName: "get_missing_tenant_variables", config: { toolset: "tenants", readOnly: true }, registerFn: registerGetMissingTenantVariablesTool, });
- src/tools/getMissingTenantVariables.ts:7-51 (registration)The registration function that calls server.tool() to register the tool on the MCP server, including name, description, schema, output hints, and handler.export function registerGetMissingTenantVariablesTool(server: McpServer) { server.tool( "get_missing_tenant_variables", `Get missing tenant variables This tool retrieves tenant variables that are missing values. Optionally filter by tenant, project, or environment.`, { spaceName: z.string().describe("The space name"), tenantId: z.string().optional().describe("Filter by specific tenant ID"), projectId: z.string().optional().describe("Filter by specific project ID"), environmentId: z.string().optional().describe("Filter by specific environment ID"), includeDetails: z.boolean().optional().describe("Include detailed information about missing variables") }, { title: "Get missing tenant variables from Octopus Deploy", readOnlyHint: true, }, async ({ spaceName, tenantId, projectId, environmentId, includeDetails = false }) => { const configuration = getClientConfigurationFromEnvironment(); const client = await Client.create(configuration); const tenantRepository = new TenantRepository(client, spaceName); const filterOptions = { tenantId, projectId, environmentId }; const missingVariables = await tenantRepository.missingVariables(filterOptions, includeDetails); return { content: [ { type: "text", text: JSON.stringify({ filters: filterOptions, includeDetails, missingVariables }), }, ], }; } ); }
- src/tools/index.ts:58-65 (registration)Top-level function that registers all enabled tools by calling their individual registerFn, including get_missing_tenant_variables if enabled.export function registerTools(server: McpServer, config: ToolsetConfig = {}) { // Iterate through all registered tools and register those that are enabled for (const [, toolRegistration] of TOOL_REGISTRY) { if (isToolEnabled(toolRegistration, config)) { toolRegistration.registerFn(server); } } }