Skip to main content
Glama
aliyun

Alibaba Cloud FC MCP Server

Official
by aliyun

delete-function-version

Remove specific versions of serverless functions in Alibaba Cloud Function Compute to manage deployments and control function lifecycle.

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
versionIdYes函数版本ID

Implementation Reference

  • Handler function that validates inputs, creates FC client, and calls deleteFunctionVersion API.
            const { functionName, region, versionId } = 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.deleteFunctionVersion(functionName, versionId);
                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:860-889 (registration)
    Registration of the delete-function-version tool using server.tool, including schema and inline handler.
    server.tool(
        "delete-function-version",
        "删除函数计算的函数版本",
        {
            functionName: functionNameSchema,
            region: regionSchema,
            versionId: versionIdSchema,
        },
        async (args) => {
            const { functionName, region, versionId } = 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.deleteFunctionVersion(functionName, versionId);
                return { content: [{ type: "text", text: `删除函数版本成功。result: ${JSON.stringify(result)}` }] };
            } catch (error) {
                return { isError: true, content: [{ type: "text", text: `删除函数版本失败:${JSON.stringify(error as any)}` }] };
            }
        }
    )
    
    // 部署函数自定义运行时runtime的提示词
  • Input schema definition for the tool using imported Zod schemas.
        functionName: functionNameSchema,
        region: regionSchema,
        versionId: versionIdSchema,
    },
  • Zod schema for versionId parameter used in the tool.
    export const versionIdSchema = z.string().describe("函数版本ID");
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the action is 'delete' which implies a destructive mutation, but doesn't disclose critical behavioral traits: whether deletion is permanent/reversible, if it affects associated resources (e.g., aliases, triggers), required permissions, or error conditions (e.g., cannot delete active versions).

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 with zero waste. It's front-loaded with the core action and resource, making it immediately understandable 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?

For a destructive mutation tool with no annotations and no output schema, the description is incomplete. It lacks critical context: behavioral implications (permanence, side effects), prerequisites, error handling, and what happens post-deletion (e.g., confirmation, returned data). The high schema coverage doesn't compensate for these gaps in operational guidance.

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 each parameter well-documented in the schema (functionName uniqueness, region enum with default, versionId). The description adds no additional parameter semantics beyond what's already in the schema, so baseline 3 is appropriate.

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 (delete) and resource (function version in function computing). It's specific about what gets deleted, though it doesn't explicitly differentiate from sibling tools like 'delete-function' which deletes the entire function rather than a specific version.

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?

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites (e.g., whether the function version must be inactive), nor does it reference sibling tools like 'delete-function' (for entire functions) or 'list-function-versions' (to see available versions).

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