Skip to main content
Glama
OctopusDeploy

Octopus Deploy MCP Server

Official

get_certificate

Retrieve certificate details by ID from Octopus Deploy to inspect configuration and troubleshoot deployment issues.

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
NameRequiredDescriptionDefault
spaceNameYes
certificateIdYesThe ID of the certificate to retrieve

Implementation Reference

  • The handler function that executes the tool logic: creates an Octopus Deploy client from environment config, resolves the space ID, fetches the certificate resource by ID, maps it to a custom type, and returns it as JSON 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),
            },
          ],
        };
      }
    );
  • Input schema using Zod: requires spaceName (string) and certificateId (string).
    {
      spaceName: z.string(),
      certificateId: z.string().describe("The ID of the certificate to retrieve"),
    },
  • Main registration function that calls server.tool() to register the 'get_certificate' tool on the MCP server, including 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),
              },
            ],
          };
        }
      );
    }
  • Self-registration of the tool definition into the TOOL_REGISTRY, specifying toolset 'certificates' and read-only, for conditional registration in src/tools/index.ts.
    registerToolDefinition({
      toolName: "get_certificate",
      config: { toolset: "certificates", readOnly: true },
      registerFn: registerGetCertificateTool,
    });

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