Skip to main content
Glama

create_site_txt_record

Add a TXT DNS record to a website in the ESA MCP Server by specifying the site ID, record name, and text value to configure domain verification or email security.

Instructions

Creates a DNS record for a specific website. Only TXT records are supported.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
siteIdYesThe website ID, which can be obtained by calling the [ListSites] operation.
recordNameYesThe record name.
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.

Implementation Reference

  • The main handler function for the 'create_site_txt_record' tool. It extracts the request arguments, sets the record type to 'TXT', defaults TTL to 1 if not provided, calls the API to create the record, and returns the response.
    export const create_site_txt_record = async (request: CallToolRequest) => {
      const req = request.params.arguments as CreateRecordRequest;
    
      req.type = 'TXT';
      req.ttl = req.ttl || 1;
    
      const res = await api.createRecord(req);
    
      return {
        content: [{ type: 'text', text: JSON.stringify(res) }],
        success: true,
      };
    };
  • The input schema defining the parameters for the 'create_site_txt_record' tool, including siteId, recordName, ttl, data.value (TXT content), and comment.
    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'],
        },
        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: 'A valid text string. Required.',
              example: ['xxxxxxxxxxxxxxxxxx'],
            },
          },
        },
        comment: {
          type: 'string',
          description:
            'The comment of the record. The maximum length is 100 characters.',
        },
      },
      required: ['siteId', 'recordName', 'type', 'data'],
      annotations: {
        readOnlyHint: false,
        destructiveHint: false,
        idempotentHint: false,
        openWorldHint: false,
      },
  • The Tool object definition for 'create_site_txt_record', which includes the name, description, and inputSchema. This is exported and used for registration.
    export const CREATE_SITE_TXT_RECORD_TOOL: Tool = {
      name: 'create_site_txt_record',
      description:
        'Creates a DNS record for a specific website. Only TXT records are supported.',
      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'],
          },
          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: 'A valid text string. Required.',
                example: ['xxxxxxxxxxxxxxxxxx'],
              },
            },
          },
          comment: {
            type: 'string',
            description:
              'The comment of the record. The maximum length is 100 characters.',
          },
        },
        required: ['siteId', 'recordName', 'type', 'data'],
        annotations: {
          readOnlyHint: false,
          destructiveHint: false,
          idempotentHint: false,
          openWorldHint: false,
        },
      },
    };
  • Registration of the CREATE_SITE_TXT_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,
    ];
  • Registration of the create_site_txt_record handler function in the esaHandlers object, mapping tool names to their implementations.
    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,
    };

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