get_certificate
Retrieve detailed certificate information by ID from Octopus Deploy to inspect certificate properties and verify configuration settings.
Instructions
Get details for a specific certificate by its ID
This tool retrieves detailed information about a specific certificate using its ID. The space name and certificate ID are both required.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| certificateId | Yes | The ID of the certificate to retrieve | |
| spaceName | Yes |
Implementation Reference
- src/tools/getCertificate.ts:22-46 (handler)The core handler function for the 'get_certificate' tool. It fetches the certificate by ID from the specified Octopus Deploy space using the API client, maps the response, and returns it as JSON-formatted text content.async ({ spaceName, certificateId }) => { const configuration = getClientConfigurationFromEnvironment(); const client = await Client.create(configuration); const spaceId = await resolveSpaceId(client, spaceName); const response = await client.get<CertificateResource>( "~/api/{spaceId}/certificates/{id}", { spaceId, id: certificateId, } ); const certificate = mapCertificateResource(response); return { content: [ { type: "text", text: JSON.stringify(certificate), }, ], }; } );
- src/tools/getCertificate.ts:14-17 (schema)Input schema defined using Zod for the tool parameters: spaceName (string) and certificateId (string). Defines the expected inputs for retrieving a certificate.{ spaceName: z.string(), certificateId: z.string().describe("The ID of the certificate to retrieve"), },
- src/tools/getCertificate.ts:8-47 (registration)The registerGetCertificateTool function that registers the 'get_certificate' tool on the MCP server, including name, description, input schema, output metadata, and handler.export function registerGetCertificateTool(server: McpServer) { server.tool( "get_certificate", `Get details for a specific certificate by its ID This tool retrieves detailed information about a specific certificate using its ID. The space name and certificate ID are both required.`, { spaceName: z.string(), certificateId: z.string().describe("The ID of the certificate to retrieve"), }, { title: "Get a specific certificate by ID from an Octopus Deploy space", readOnlyHint: true, }, async ({ spaceName, certificateId }) => { const configuration = getClientConfigurationFromEnvironment(); const client = await Client.create(configuration); const spaceId = await resolveSpaceId(client, spaceName); const response = await client.get<CertificateResource>( "~/api/{spaceId}/certificates/{id}", { spaceId, id: certificateId, } ); const certificate = mapCertificateResource(response); return { content: [ { type: "text", text: JSON.stringify(certificate), }, ], }; } ); }
- src/tools/getCertificate.ts:49-53 (registration)Self-registration of the 'get_certificate' tool via registerToolDefinition, specifying toolset 'certificates' and read-only nature, linking to the register function.registerToolDefinition({ toolName: "get_certificate", config: { toolset: "certificates", readOnly: true }, registerFn: registerGetCertificateTool, });