Skip to main content
Glama

apply_certificate

Apply for a free SSL certificate by specifying site ID, domains, and certificate type to secure website connections.

Instructions

Applies for a free SSL certificate.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
siteIdYesSite ID. Example: 1234567890123. Reference Value Source: list_sites
domainsYesThe list of domain names, separated by commas. Example: "example.com,www.example.com"
typeYesThe type of certificate. Possible values: - lets_encrypt (Let's Encrypt certificate) - digicert_single (Digicert single-domain certificate) - digicert_wildcard (Digicert wildcard certificate)

Implementation Reference

  • The primary handler function implementing the logic for the 'apply_certificate' MCP tool. It invokes the API service with the provided arguments and formats the response.
    export const apply_certificate = async (request: CallToolRequest) => {
      const res = await api.applyCertificate(
        request.params.arguments as ApplyCertificateRequest,
      );
    
      return {
        content: [{ type: 'text', text: JSON.stringify(res) }],
        success: true,
      };
    };
  • Tool registration object APPLY_CERTIFICATE_TOOL defining the name, description, and input schema for validation.
    export const APPLY_CERTIFICATE_TOOL: Tool = {
      name: 'apply_certificate',
      description: 'Applies for a free SSL certificate.',
      inputSchema: {
        type: 'object',
        properties: {
          siteId: {
            type: 'number',
            description:
              'Site ID. Example: 1234567890123. Reference Value Source: list_sites',
          },
          domains: {
            type: 'string',
            description:
              'The list of domain names, separated by commas. Example: "example.com,www.example.com"',
          },
    
          type: {
            type: 'string',
            description:
              "The type of certificate. Possible values: - lets_encrypt (Let's Encrypt certificate) - digicert_single (Digicert single-domain certificate) - digicert_wildcard (Digicert wildcard certificate)  ",
          },
        },
        required: ['siteId', 'domains', 'type'],
        annotations: {},
      },
    };
  • Registration of APPLY_CERTIFICATE_TOOL in the CERTIFICATE_LIST array, which is merged into the main ESA_OPENAPI_LIST of tools.
    export const CERTIFICATE_LIST = [
      SET_CERTIFICATE_TOOL,
      APPLY_CERTIFICATE_TOOL,
      GET_CERTIFICATE_TOOL,
      DELETE_CERTIFICATE_TOOL,
      LIST_CERTIFICATES_TOOL,
      GET_CERTIFICATE_QUOTA_TOOL,
    ];
  • Mapping of the 'apply_certificate' handler function in the esaHandlers object for tool dispatch.
    export const esaHandlers: ToolHandlers = {
      site_active_list,
      site_match,
      site_route_list,
      site_record_list,
      routine_create,
      routine_code_commit,
      routine_delete,
      routine_list,
      routine_get,
      routine_code_deploy,
      routine_route_list,
      deployment_delete,
      route_create,
      route_delete,
      route_update,
      route_get,
      er_record_create,
      er_record_delete,
      er_record_list,
      html_deploy,
      create_site,
      update_site_pause,
      get_site_pause,
      create_site_mx_record,
      create_site_ns_record,
      create_site_txt_record,
      create_site_cname_record,
      create_site_a_or_aaaa_record,
      update_record,
      list_records,
      get_record,
      delete_record,
      update_ipv6,
      get_ipv6,
      update_managed_transform,
      get_managed_transform,
      set_certificate,
      apply_certificate,
      get_certificate,
      delete_certificate,
      list_certificates,
      get_certificate_quota,
      list_sites,
    };
  • Supporting API wrapper method 'applyCertificate' in the service client that constructs the request and calls the Alibaba Cloud ESA SDK client.
    applyCertificate(params: ApplyCertificateRequest) {
      const request = new ApplyCertificateRequest(params);
      return this.callApi(
        this.client.applyCertificate.bind(this.client) as ApiMethod<
          ApplyCertificateRequest,
          ApplyCertificateResponse
        >,
        request,
      );
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions 'Applies for' which implies a write operation, but doesn't specify if it's idempotent, requires specific permissions, has rate limits, or what happens on failure. This leaves significant gaps in understanding the tool's behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence with zero waste. It's front-loaded and efficiently conveys the core action without unnecessary elaboration, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of applying for an SSL certificate, no annotations, and no output schema, the description is insufficient. It doesn't explain what the tool returns, potential errors, or dependencies on other tools like 'list_sites', leaving the agent with incomplete context for effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, detailing each parameter's purpose and examples. The description adds no additional meaning beyond the schema, such as explaining interactions between parameters or edge cases. Baseline 3 is appropriate since the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Applies for') and resource ('a free SSL certificate'), making the purpose evident. However, it doesn't differentiate from sibling tools like 'set_certificate' or 'get_certificate', which might handle certificate operations differently, so it doesn't reach the highest score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'set_certificate' or 'delete_certificate'. The description lacks context about prerequisites, such as needing a site from 'list_sites', or exclusions, leaving the agent with minimal usage direction.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/aliyun/mcp-server-esa'

If you have feedback or need assistance with the MCP directory API, please join our Discord server