list-functions
Retrieve a filtered list of Alibaba Cloud Function Compute functions by region, name prefix, tags, or runtime to manage serverless deployments efficiently.
Instructions
获取函数计算的函数列表,只返回函数名称与部分函数信息,不返回所有函数信息。如果需要获取所有函数信息,请使用get-function工具
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| region | No | 部署的区域,当前可选的区域是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 | cn-hangzhou |
| prefix | No | 函数名称前缀,用于过滤函数列表 | |
| nextToken | No | 函数列表的下一页token,用于分页查询函数列表。第一页不需要提供 | |
| limit | No | 函数列表的返回数量上限,默认50,最大100 | |
| tags | No | 函数标签,用于过滤函数列表,只返回包含所有标签的函数 | |
| runtime | No | 函数运行时,用于过滤函数列表,只返回指定运行时的函数 |
Implementation Reference
- src/index.ts:586-606 (registration)Registration of the 'list-functions' MCP tool using server.tool(). Includes tool name, Chinese description, Zod input schema (region required, optional prefix/nextToken/limit/tags/runtime), and inline async handler function.server.tool( "list-functions", "获取函数计算的函数列表,只返回函数名称与部分函数信息,不返回所有函数信息。如果需要获取所有函数信息,请使用get-function工具", { region: regionSchema, prefix: listFunctionsPrefixSchema.optional(), nextToken: listFunctionsNextTokenSchema.optional(), limit: z.number().describe("函数列表的返回数量上限,默认50,最大100").min(1).max(100).default(50), tags: functionTagSchema.describe("函数标签,用于过滤函数列表,只返回包含所有标签的函数").optional(), runtime: z.string().describe("函数运行时,用于过滤函数列表,只返回指定运行时的函数").optional(), }, async (args) => { const { region } = args; const fcClient = createFcClient(region); const listFunctionsRequest = new ListFunctionsRequest({ ...args }); const functions = await fcClient.listFunctions(listFunctionsRequest); return { content: [{ type: "text", text: `获取函数列表: ${JSON.stringify(functions)}` }] }; } )
- src/index.ts:597-606 (handler)Inline handler for 'list-functions' tool. Extracts region from args, creates FC client using createFcClient, builds ListFunctionsRequest with spread args, calls SDK listFunctions API, returns result as JSON-formatted text content.async (args) => { const { region } = args; const fcClient = createFcClient(region); const listFunctionsRequest = new ListFunctionsRequest({ ...args }); const functions = await fcClient.listFunctions(listFunctionsRequest); return { content: [{ type: "text", text: `获取函数列表: ${JSON.stringify(functions)}` }] }; } )
- src/index.ts:589-596 (schema)Input schema for 'list-functions' tool defined inline with Zod, using imported schemas for region/prefix/nextToken/tags and custom z.number() for limit, z.string() for runtime.{ region: regionSchema, prefix: listFunctionsPrefixSchema.optional(), nextToken: listFunctionsNextTokenSchema.optional(), limit: z.number().describe("函数列表的返回数量上限,默认50,最大100").min(1).max(100).default(50), tags: functionTagSchema.describe("函数标签,用于过滤函数列表,只返回包含所有标签的函数").optional(), runtime: z.string().describe("函数运行时,用于过滤函数列表,只返回指定运行时的函数").optional(), },
- src/schema.ts:4-6 (schema)Zod schema definition for 'region' parameter used in 'list-functions' tool.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");
- src/utils/alibaba_cloud_sdk.ts:11-17 (helper)Helper function createFcClient used by the handler to instantiate the Alibaba Cloud Function Compute (FC) v3 client for the specified region.export function createFcClient(regionId: string) { const config = new $OpenApi.Config({ credential: getCredentialClient(), endpoint: `fcv3.${regionId}.aliyuncs.com`, }); return new FCClient(config); }