Skip to main content
Glama

create_site_cname_record

Add a CNAME DNS record to route website traffic through Edge Security Acceleration services for improved performance and security.

Instructions

Creates a DNS record for a specific website. Only supports records with type=CNAME and sourceType=Domain.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
siteIdYesThe website ID, which can be obtained by calling the [ListSites] operation.
recordNameYesThe record name.
sourceTypeNoThe origin type for the CNAME record. This parameter is required when you add a CNAME record. Valid values: - Domain: domain name If you do not pass this parameter or if you leave its value empty, Domain is used by default.
bizNameNoThe business scenario of the record for acceleration. Leave the parameter empty if your record is not proxied. Valid values: - image_video - api - web
ttlNoThe TTL of the record. Unit: seconds. If the value is 1, the TTL of the record is determined by the system. Default: 1.
dataYesThe DNS record information. The format of this field varies based on the record type. For more information, see https://www.alibabacloud.com/help/doc-detail/2708761.html
commentNoThe comment of the record. The maximum length is 100 characters.
hostPolicyNoThe origin host policy. This policy takes effect when the record type is CNAME. Required. You can set the policy in two modes: - follow_hostname - follow_origin_domain

Implementation Reference

  • The main handler function for the 'create_site_cname_record' tool. It sets the record type to 'CNAME', sourceType to 'Domain', enables proxying, and calls the API to create the record.
    export const create_site_cname_record = async (request: CallToolRequest) => {
      const req = request.params.arguments as CreateRecordRequest;
    
      req.type = 'CNAME';
      req.sourceType = 'Domain';
      req.proxied = true;
      req.ttl = req.ttl || 1;
    
      if (req.sourceType !== 'Domain') {
        return {
          content: [{ type: 'text', text: 'sourceType must be Domain' }],
          success: false,
        };
      }
    
      const res = await api.createRecord(req);
    
      return {
        content: [{ type: 'text', text: JSON.stringify(res) }],
        success: true,
      };
    };
  • The Tool definition including name, description, and detailed inputSchema for validating parameters like siteId, recordName, data.value (target domain), etc.
    export const CREATE_SITE_CNAME_RECORD_TOOL: Tool = {
      name: 'create_site_cname_record',
      description:
        'Creates a DNS record for a specific website. Only supports records with type=CNAME and sourceType=Domain.',
      inputSchema: {
        type: 'object',
        properties: {
          siteId: {
            type: 'number',
            description:
              'The website ID, which can be obtained by calling the [ListSites] operation.',
          },
          recordName: {
            type: 'string',
            description: 'The record name.',
            examples: ['www.example.com'],
          },
          sourceType: {
            type: 'string',
            description:
              'The origin type for the CNAME record. This parameter is required when you add a CNAME record. Valid values:\n- Domain: domain name\n\nIf you do not pass this parameter or if you leave its value empty, Domain is used by default.',
            enum: ['Domain'],
            examples: ['Domain'],
          },
          bizName: {
            type: 'string',
            description:
              'The business scenario of the record for acceleration. Leave the parameter empty if your record is not proxied. Valid values:\n- image_video\n- api\n- web',
            enum: ['image_video', 'api', 'web'],
            examples: ['web'],
          },
          ttl: {
            type: 'number',
            description:
              'The TTL of the record. Unit: seconds. If the value is 1, the TTL of the record is determined by the system. Default: 1.',
            examples: [1],
          },
          data: {
            type: 'object',
            description:
              'The DNS record information. The format of this field varies based on the record type. For more information, see https://www.alibabacloud.com/help/doc-detail/2708761.html',
            properties: {
              value: {
                type: 'string',
                description: 'The target domain name. Required.',
                example: ['origin.example.com'],
              },
            },
          },
          comment: {
            type: 'string',
            description:
              'The comment of the record. The maximum length is 100 characters.',
          },
          hostPolicy: {
            type: 'string',
            description:
              'The origin host policy. This policy takes effect when the record type is CNAME. Required. You can set the policy in two modes:\n- follow_hostname\n- follow_origin_domain',
            enum: ['follow_hostname', 'follow_origin_domain'],
            examples: ['follow_hostname'],
          },
        },
        required: ['siteId', 'recordName', 'type', 'data'],
        annotations: {
          readOnlyHint: false,
          destructiveHint: false,
          idempotentHint: false,
          openWorldHint: false,
        },
      },
    };
  • Registration of the CREATE_SITE_CNAME_RECORD_TOOL in the ESA_OPENAPI_SITE_LIST array, which collects tools for the ESA OpenAPI.
    export const ESA_OPENAPI_SITE_LIST = [
      LIST_SITES_TOOL,
      CREATE_SITE_TOOL,
      UPDATE_SITE_PAUSE_TOOL,
      GET_SITE_PAUSE_TOOL,
      UPDATE_RECORD_TOOL,
      CREATE_SITE_MX_RECORD_TOOL,
      CREATE_SITE_NS_RECORD_TOOL,
      CREATE_SITE_TXT_RECORD_TOOL,
      CREATE_SITE_CNAME_RECORD_TOOL,
      CREATE_SITE_A_OR_AAAA_RECORD_TOOL,
      DELETE_RECORD_TOOL,
      LIST_RECORDS_TOOL,
      GET_RECORD_TOOL,
    ];
  • Maps the 'create_site_cname_record' handler function to the esaHandlers object for tool execution dispatching.
    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,
    };
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states 'Creates a DNS record,' which implies a write operation, but does not disclose behavioral traits such as required permissions, whether the operation is idempotent, potential side effects, or error conditions. This is a significant gap for a mutation tool with zero annotation coverage.

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, efficient sentence that front-loads the purpose and constraints with zero waste. Every word earns its place, making it easy to parse quickly.

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

Completeness3/5

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

For a mutation tool with no annotations and no output schema, the description is minimally adequate. It specifies the tool's purpose and constraints, but lacks details on behavioral aspects (e.g., permissions, idempotency) and does not explain return values or error handling, leaving gaps in completeness.

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?

Schema description coverage is 100%, so the schema already documents all 8 parameters thoroughly. The description adds no additional parameter semantics beyond what the schema provides, such as explaining interactions between parameters or usage examples. Baseline 3 is appropriate when the schema does the heavy lifting.

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

Purpose5/5

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

The description clearly states the action ('Creates a DNS record') and the specific resource ('for a specific website'), with explicit constraints ('Only supports records with type=CNAME and sourceType=Domain'). This distinguishes it from sibling tools like create_site_a_or_aaaa_record or create_site_txt_record, which handle different DNS record types.

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

Usage Guidelines4/5

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

The description provides clear context on when to use this tool by specifying the supported record types (CNAME with sourceType=Domain). It implies alternatives through sibling tools for other record types, but does not explicitly name them or state when not to use this tool (e.g., for non-CNAME records).

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