Skip to main content
Glama
aliyun

Alibaba Cloud FC MCP Server

Official
by aliyun

get-custom-domain-config

Retrieve custom domain routing configurations for Alibaba Cloud Function Compute services to manage how domains direct traffic to serverless functions.

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://'等协议内容

Implementation Reference

  • src/index.ts:646-672 (registration)
    Registration of the 'get-custom-domain-config' tool using MCP server.tool, including inline input schema and handler function.
    server.tool(
        "get-custom-domain-config",
        "查询函数计算的域名路由配置",
        {
            region: regionSchema,
            domain: domainSchema,
        },
        async (args) => {
            const { region, domain } = 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);
            try {
                const result = await fcClient.getCustomDomain(domain);
                return { content: [{ type: "text", text: `查询路由配置成功。result: ${JSON.stringify(result)}` }] };
            } catch (error) {
                return { isError: true, content: [{ type: "text", text: `查询路由配置失败:${JSON.stringify(error as any)}` }] };
            }
        }
    )
  • The handler function that validates credentials, creates the Alibaba Cloud FC client, and calls getCustomDomain to retrieve the custom domain configuration.
    async (args) => {
        const { region, domain } = 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);
        try {
            const result = await fcClient.getCustomDomain(domain);
            return { content: [{ type: "text", text: `查询路由配置成功。result: ${JSON.stringify(result)}` }] };
        } catch (error) {
            return { isError: true, content: [{ type: "text", text: `查询路由配置失败:${JSON.stringify(error as any)}` }] };
        }
    }
  • Inline input schema for the tool using imported regionSchema and domainSchema.
    {
        region: regionSchema,
        domain: domainSchema,
    },
  • Zod schema definition for the 'domain' input parameter.
    export const domainSchema = z.string().describe("域名,例如example.com,域名不能带有'https://'或'http://'等协议内容");
  • Zod schema definition for the 'region' input parameter.
    export const regionSchema = z.enum(['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'])
        .default('cn-hangzhou')
        .describe("部署的区域,当前可选的区域是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-hangzhou");
  • Helper function to create the Alibaba Cloud Function Compute client used in the 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?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states '查询' (query), implying a read-only operation, but doesn't clarify if this requires authentication, what happens on errors, or the format of returned data. For a tool with no annotation coverage, this leaves significant gaps in understanding its behavior and constraints.

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 in Chinese that directly states the tool's purpose without unnecessary words. It's front-loaded with the core action and resource, making it easy to parse. There's no wasted verbiage, and it fits well within a concise format.

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 a domain configuration query tool with no annotations and no output schema, the description is insufficient. It doesn't explain what the query returns (e.g., routing rules, status), potential errors, or how it interacts with sibling tools. For a tool that likely returns structured data, more context is needed to guide 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?

Schema description coverage is 100%, with both parameters ('region' and 'domain') well-documented in the schema, including enum values and format rules. The description adds no additional meaning beyond what the schema provides, such as explaining the relationship between parameters. With high schema coverage, the baseline score of 3 is appropriate as the schema handles parameter semantics adequately.

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

Purpose3/5

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

The description '查询函数计算的域名路由配置' (Query function computing domain routing configuration) states the action (query) and resource (domain routing configuration for function computing), which provides a basic purpose. However, it doesn't distinguish this read operation from its siblings like 'get-function' or 'list-functions', nor does it specify what exactly is being queried (e.g., all configurations vs. a specific one). It's clear but vague on scope.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'create-custom-domain-config' or 'update-custom-domain-config', nor does it specify prerequisites (e.g., needing an existing domain). Without any context on usage scenarios or exclusions, the agent lacks 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/alibabacloud-fc-mcp-server'

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