list_certificates
Retrieve and filter certificates within a specific Octopus Deploy space to manage security credentials and access configurations.
Instructions
List certificates in a space
This tool lists all certificates in a given space. The space name is required. You can optionally filter by various parameters like name, archived status, tenant, etc.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| archived | No | ||
| firstResult | No | ||
| ids | No | ||
| orderBy | No | ||
| partialName | No | ||
| search | No | ||
| skip | No | ||
| spaceName | Yes | ||
| take | No | ||
| tenant | No |
Implementation Reference
- src/tools/listCertificates.ts:30-78 (handler)The handler function for the 'list_certificates' tool. It creates an Octopus Deploy client, resolves the space ID, queries the certificates API with provided filters, maps the certificate resources, and returns a structured JSON response.async ({ spaceName, skip, take, search, archived, tenant, firstResult, orderBy, ids, partialName, }) => { const configuration = getClientConfigurationFromEnvironment(); const client = await Client.create(configuration); const spaceId = await resolveSpaceId(client, spaceName); const response = await client.get<ResourceCollection<CertificateResource>>( "~/api/{spaceId}/certificates{?skip,take,search,archived,tenant,firstResult,orderBy,ids,partialName}", { spaceId, skip, take, search, archived, tenant, firstResult, orderBy, ids, partialName, } ); const certificates = response.Items.map((cert: CertificateResource) => mapCertificateResource(cert)); return { content: [ { type: "text", text: JSON.stringify({ totalResults: response.TotalResults, itemsPerPage: response.ItemsPerPage, numberOfPages: response.NumberOfPages, lastPageNumber: response.LastPageNumber, items: certificates, }), }, ], }; }
- src/tools/listCertificates.ts:15-25 (schema)Input schema using Zod validators for the tool parameters: spaceName (required string), optional numeric and string filters for pagination, search, status, and selection.spaceName: z.string(), skip: z.number().optional(), take: z.number().optional(), search: z.string().optional(), archived: z.boolean().optional(), tenant: z.string().optional(), firstResult: z.number().optional(), orderBy: z.string().optional(), ids: z.array(z.string()).optional(), partialName: z.string().optional(), },
- src/tools/listCertificates.ts:8-80 (registration)The primary registration function for the 'list_certificates' tool, called by the tool registry to register it on the MCP server with name, description, input schema, output hints, and handler.export function registerListCertificatesTool(server: McpServer) { server.tool( "list_certificates", `List certificates in a space This tool lists all certificates in a given space. The space name is required. You can optionally filter by various parameters like name, archived status, tenant, etc.`, { spaceName: z.string(), skip: z.number().optional(), take: z.number().optional(), search: z.string().optional(), archived: z.boolean().optional(), tenant: z.string().optional(), firstResult: z.number().optional(), orderBy: z.string().optional(), ids: z.array(z.string()).optional(), partialName: z.string().optional(), }, { title: "List all certificates in an Octopus Deploy space", readOnlyHint: true, }, async ({ spaceName, skip, take, search, archived, tenant, firstResult, orderBy, ids, partialName, }) => { const configuration = getClientConfigurationFromEnvironment(); const client = await Client.create(configuration); const spaceId = await resolveSpaceId(client, spaceName); const response = await client.get<ResourceCollection<CertificateResource>>( "~/api/{spaceId}/certificates{?skip,take,search,archived,tenant,firstResult,orderBy,ids,partialName}", { spaceId, skip, take, search, archived, tenant, firstResult, orderBy, ids, partialName, } ); const certificates = response.Items.map((cert: CertificateResource) => mapCertificateResource(cert)); return { content: [ { type: "text", text: JSON.stringify({ totalResults: response.TotalResults, itemsPerPage: response.ItemsPerPage, numberOfPages: response.NumberOfPages, lastPageNumber: response.LastPageNumber, items: certificates, }), }, ], }; } ); }
- src/tools/listCertificates.ts:82-86 (registration)Self-registration of the tool in the global TOOL_REGISTRY, specifying toolset and read-only config for conditional enabling in index.ts.registerToolDefinition({ toolName: "list_certificates", config: { toolset: "certificates", readOnly: true }, registerFn: registerListCertificatesTool, });
- src/tools/index.ts:30-30 (registration)Import statement that triggers the self-registration of listCertificates tool when index.ts is imported.import './listCertificates.js';