Skip to main content
Glama
aliyun

Alibaba Cloud FC MCP Server

Official
by aliyun

list-function-versions

Retrieve available versions of a specific Alibaba Cloud Function Compute function to manage deployments and track changes.

Instructions

获取函数计算的函数版本列表

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
functionNameYes函数名称,函数名称在每个region必须是唯一的。
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
nextTokenNo函数版本列表的下一页token,用于分页查询函数版本列表。第一页不需要提供
directionNo函数版本列表的排序方向,BACKWARD表示按版本号降序,FORWARD表示按版本号升序BACKWARD
limitNo函数版本列表的返回数量上限,默认50,最大100

Implementation Reference

  • The handler function extracts parameters, checks credentials, creates FC client, builds and sends ListFunctionVersionsRequest to list function versions, returns success or error response.
    async (args) => {
        const { functionName, region, nextToken, direction, limit } = 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 listFunctionVersionsRequest = new ListFunctionVersionsRequest({
            functionName,
            direction,
        })
        if (nextToken) {
            listFunctionVersionsRequest.nextToken = nextToken;
        }
        if (limit) {
            listFunctionVersionsRequest.limit = limit;
        }
        try {
            const listFunctionVersionsResult = await fcClient.listFunctionVersions(functionName, listFunctionVersionsRequest);
            return { content: [{ type: "text", text: `获取函数版本列表成功。result: ${JSON.stringify(listFunctionVersionsResult)}` }] };
        } catch (error) {
            return { isError: true, content: [{ type: "text", text: `获取函数版本列表失败:${JSON.stringify(error as any)}` }] };
        }
    
    }
  • src/index.ts:817-857 (registration)
    Registers the 'list-function-versions' MCP tool with name, description, input schema, and handler function.
    server.tool(
        "list-function-versions",
        "获取函数计算的函数版本列表",
        {
            functionName: functionNameSchema,
            region: regionSchema,
            nextToken: listFunctionVersionsNextTokenSchema.optional(),
            direction: listFunctionVersionsDirectionSchema,
            limit: listFunctionVersionsLimitSchema.optional(),
        },
        async (args) => {
            const { functionName, region, nextToken, direction, limit } = 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 listFunctionVersionsRequest = new ListFunctionVersionsRequest({
                functionName,
                direction,
            })
            if (nextToken) {
                listFunctionVersionsRequest.nextToken = nextToken;
            }
            if (limit) {
                listFunctionVersionsRequest.limit = limit;
            }
            try {
                const listFunctionVersionsResult = await fcClient.listFunctionVersions(functionName, listFunctionVersionsRequest);
                return { content: [{ type: "text", text: `获取函数版本列表成功。result: ${JSON.stringify(listFunctionVersionsResult)}` }] };
            } catch (error) {
                return { isError: true, content: [{ type: "text", text: `获取函数版本列表失败:${JSON.stringify(error as any)}` }] };
            }
    
        }
    )
  • Zod schema definitions for pagination and filtering parameters specific to list-function-versions tool: nextToken, limit, direction.
    export const listFunctionsPrefixSchema = z.string().describe("函数名称前缀,用于过滤函数列表");
    
    export const listFunctionsNextTokenSchema = z.string().describe("函数列表的下一页token,用于分页查询函数列表。第一页不需要提供");
    
    export const listFunctionVersionsNextTokenSchema = z.string().describe("函数版本列表的下一页token,用于分页查询函数版本列表。第一页不需要提供");
    
    export const listFunctionVersionsLimitSchema = z.number().describe("函数版本列表的返回数量上限,默认50,最大100").min(1).max(100).default(50);
    
    export const listFunctionVersionsDirectionSchema = z.enum(["BACKWARD", "FORWARD"]).describe("函数版本列表的排序方向,BACKWARD表示按版本号降序,FORWARD表示按版本号升序").default("BACKWARD");
    
    export const versionIdSchema = z.string().describe("函数版本ID");
  • Input schema object composing imported Zod schemas for tool parameters.
    {
        functionName: functionNameSchema,
        region: regionSchema,
        nextToken: listFunctionVersionsNextTokenSchema.optional(),
        direction: listFunctionVersionsDirectionSchema,
        limit: listFunctionVersionsLimitSchema.optional(),
    },
  • Helper function to create the Alibaba Cloud FC client instance 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?

With no annotations provided, the description carries the full burden of behavioral disclosure but provides minimal information. It states it retrieves a list but doesn't describe pagination behavior (implied by 'nextToken' parameter but not explained), rate limits, authentication requirements, error conditions, or what the output looks like. For a list operation with 5 parameters and no annotations, this leaves significant behavioral gaps.

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 Chinese sentence that states exactly what the tool does without any unnecessary words. It's front-loaded with the core purpose and wastes no space on redundant information. This is an excellent example of conciseness.

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?

For a tool with 5 parameters, no annotations, and no output schema, the description is insufficiently complete. It doesn't explain the relationship between parameters, pagination behavior, typical response structure, or error handling. While the schema documents parameters well, the description fails to provide the contextual understanding needed for effective tool use, especially given the absence of annotations and output schema.

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 schema description coverage is 100%, with all parameters well-documented in the schema itself. The description adds no additional parameter information beyond what's already in the schema descriptions. According to the rules, when schema coverage is high (>80%), the baseline is 3 even with no param info in the description, which applies here.

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 ('获取' - get/retrieve) and resource ('函数版本列表' - function version list), making the purpose immediately understandable. It doesn't explicitly differentiate from sibling tools like 'list-functions' or 'get-function', but the focus on versions is clear. This is specific enough to understand what the tool does without being tautological.

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. There's no mention of when to use 'list-function-versions' versus 'list-functions' or 'get-function', nor any context about prerequisites or typical use cases. The agent must infer usage from the tool name and parameters alone.

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