Skip to main content
Glama
aliyun

Alibaba Cloud FC MCP Server

Official
by aliyun

update-custom-domain-config

Modify custom domain routing configurations for Alibaba Cloud Function Compute, including protocols, routes, authentication, certificates, and security settings.

Instructions

更新函数计算的域名路由配置,修改域名路由配置

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
regionNo部署的区域,当前可选的区域是cn-hangzhou, cn-shanghai, cn-beijing, cn-shenzhen, cn-hongkong, ap-southeast-1, ap-southeast-2, ap-southeast-3, ap-southeast-5, ap-northeast-1, eu-central-1, eu-west-1, us-west-1, us-east-1, ap-south-1, me-east-1, cn-chengdu, cn-wulanchabu, cn-guangzhou,默认是cn-hangzhoucn-hangzhou
domainYes域名,例如example.com,域名不能带有'https://'或'http://'等协议内容
updateCustomDomainConfigYes

Implementation Reference

  • The inline asynchronous handler function that executes the core logic of the 'update-custom-domain-config' tool. It extracts parameters, checks credentials, creates the FC client, builds the UpdateCustomDomainRequest from inputs, calls the Alibaba Cloud API to update the custom domain config, and returns success or error response.
    async (args) => {
        const { region, domain, updateCustomDomainConfig } = args;
        const accessKeyId = process.env.ALIBABA_CLOUD_ACCESS_KEY_ID;
        const accessKeySecret = process.env.ALIBABA_CLOUD_ACCESS_KEY_SECRET;
        if (!accessKeyId || !accessKeySecret) {
            return { isError: true, content: [{ type: "text", text: `执行失败,请设置ALIBABA_CLOUD_ACCESS_KEY_ID, ALIBABA_CLOUD_ACCESS_KEY_SECRET, ALIBABA_CLOUD_SECURITY_TOKEN环境变量` }] };
        }
        const accountId = await getAccountId();
        if (!accountId) {
            return { isError: true, content: [{ type: "text", text: `执行失败,获取accountId异常` }] };
        }
        const fcClient = createFcClient(region);
        const updateCustomDomainRequest: UpdateCustomDomainRequest = new UpdateCustomDomainRequest({
            body: {
                authConfig: updateCustomDomainConfig.authConfig,
                certConfig: updateCustomDomainConfig.certConfig,
                tlsConfig: updateCustomDomainConfig.tlsConfig,
                wafConfig: updateCustomDomainConfig.wafConfig,
                routeConfig: updateCustomDomainConfig.routeConfig,
                protocol: updateCustomDomainConfig.protocol,
            },
        });
        try {
            const result = await fcClient.updateCustomDomain(domain, updateCustomDomainRequest);
            return { content: [{ type: "text", text: `更新域名路由配置成功。result: ${JSON.stringify(result)}` }] };
        } catch (error) {
            return { isError: true, content: [{ type: "text", text: `更新域名路由配置失败:${JSON.stringify(error as any)}` }] };
        }
    }
  • src/index.ts:675-712 (registration)
    The registration of the 'update-custom-domain-config' tool using McpServer's server.tool method, specifying name, description, input schema, and handler function.
    server.tool(
        "update-custom-domain-config",
        "更新函数计算的域名路由配置,修改域名路由配置",
        {
            region: regionSchema,
            domain: domainSchema,
            updateCustomDomainConfig: updateCustomDomainConfigSchema,
        },
        async (args) => {
            const { region, domain, updateCustomDomainConfig } = args;
            const accessKeyId = process.env.ALIBABA_CLOUD_ACCESS_KEY_ID;
            const accessKeySecret = process.env.ALIBABA_CLOUD_ACCESS_KEY_SECRET;
            if (!accessKeyId || !accessKeySecret) {
                return { isError: true, content: [{ type: "text", text: `执行失败,请设置ALIBABA_CLOUD_ACCESS_KEY_ID, ALIBABA_CLOUD_ACCESS_KEY_SECRET, ALIBABA_CLOUD_SECURITY_TOKEN环境变量` }] };
            }
            const accountId = await getAccountId();
            if (!accountId) {
                return { isError: true, content: [{ type: "text", text: `执行失败,获取accountId异常` }] };
            }
            const fcClient = createFcClient(region);
            const updateCustomDomainRequest: UpdateCustomDomainRequest = new UpdateCustomDomainRequest({
                body: {
                    authConfig: updateCustomDomainConfig.authConfig,
                    certConfig: updateCustomDomainConfig.certConfig,
                    tlsConfig: updateCustomDomainConfig.tlsConfig,
                    wafConfig: updateCustomDomainConfig.wafConfig,
                    routeConfig: updateCustomDomainConfig.routeConfig,
                    protocol: updateCustomDomainConfig.protocol,
                },
            });
            try {
                const result = await fcClient.updateCustomDomain(domain, updateCustomDomainRequest);
                return { content: [{ type: "text", text: `更新域名路由配置成功。result: ${JSON.stringify(result)}` }] };
            } catch (error) {
                return { isError: true, content: [{ type: "text", text: `更新域名路由配置失败:${JSON.stringify(error as any)}` }] };
            }
        }
    )
  • Zod schema defining the structure and validation for the 'updateCustomDomainConfig' input parameter of the tool.
    export const updateCustomDomainConfigSchema = z.object({
        protocol: protocolSchema.optional(),
        routeConfig: routeConfigSchema,
        authConfig: authConfigSchema,
        certConfig: certConfigSchema.optional(),
        tlsConfig: tlsConfigSchema.optional(),
        wafConfig: wafConfigSchema.optional(),
    });
  • Helper function to create and configure the Alibaba Cloud Function Compute (FC) client instance used in the tool handler.
    export function createFcClient(regionId: string) {
      const config = new $OpenApi.Config({
        credential: getCredentialClient(),
        endpoint: `fcv3.${regionId}.aliyuncs.com`,
      });
      return new FCClient(config);
    }
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. The description only states that it 'updates' and 'modifies' configuration, implying a mutation operation. However, it doesn't disclose important behavioral traits: whether this requires specific permissions, whether the update is idempotent, what happens to existing traffic during the update, whether there are rate limits, or what the response format looks like. For a complex configuration update tool with no annotation coverage, this is a significant gap.

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

Conciseness4/5

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

The description is extremely concise - just two Chinese phrases that essentially say the same thing. While this avoids verbosity, it's arguably under-specified rather than appropriately concise. The two phrases '更新函数计算的域名路由配置' and '修改域名路由配置' are redundant, with the second adding no new information. However, it does front-load the core purpose without unnecessary elaboration.

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 tool's complexity (3 parameters with nested objects, no annotations, no output schema), the description is woefully incomplete. A tool that updates custom domain configurations for function computing should explain the scope of changes, potential impacts, required permissions, and response expectations. The description provides none of this context, leaving the agent with insufficient information to understand when and how to use this tool effectively.

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 description provides no parameter information beyond what's in the schema. With 67% schema description coverage (2 of 3 parameters have descriptions), the schema does substantial documentation work. The description doesn't add any semantic context about parameter relationships, dependencies, or usage patterns. It doesn't explain that 'updateCustomDomainConfig' is a complex object containing protocol, routing, authentication, certificate, TLS, and WAF configurations. The baseline 3 is appropriate given the schema's documentation coverage.

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

Purpose2/5

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

The description '更新函数计算的域名路由配置,修改域名路由配置' is tautological - it essentially restates the tool name 'update-custom-domain-config' in Chinese. While it mentions 'function computing' and 'domain routing configuration', it doesn't provide a clear, specific verb+resource combination that distinguishes it from sibling tools like 'create-custom-domain-config' or 'get-custom-domain-config'. The description lacks specificity about what aspect of the configuration is being updated.

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

Usage Guidelines1/5

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

The description provides no guidance on when to use this tool versus alternatives. There are clear sibling tools for creating, deleting, and getting custom domain configurations, but the description offers no indication of prerequisites, when this update operation is appropriate versus creating a new configuration, or what state the domain must be in for this operation to succeed. This leaves the agent with no usage context.

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/alibabacloud-fc-mcp-server'

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