get_missing_tenant_variables
Identify tenant variables with missing values in Octopus Deploy. Filter results by tenant, project, or environment to resolve 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 |
|---|---|---|---|
| environmentId | No | Filter by specific environment ID | |
| includeDetails | No | Include detailed information about missing variables | |
| projectId | No | Filter by specific project ID | |
| spaceName | Yes | The space name | |
| tenantId | No | Filter by specific tenant ID |
Implementation Reference
- The handler function that executes the get_missing_tenant_variables tool. It creates an Octopus Deploy client, fetches missing tenant variables using TenantRepository, and returns the results as JSON text 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 input schema defining parameters: spaceName (required), optional filters for tenantId, projectId, environmentId, and includeDetails.{ 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:7-51 (registration)The registration function for the tool, called by the central registerTools in index.ts. It uses server.tool to register the tool name, description, input schema, output metadata, and handler with the MCP server.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/getMissingTenantVariables.ts:53-57 (registration)Self-registration of the tool into the TOOL_REGISTRY, enabling conditional registration based on config in src/tools/index.ts.registerToolDefinition({ toolName: "get_missing_tenant_variables", config: { toolset: "tenants", readOnly: true }, registerFn: registerGetMissingTenantVariablesTool, });