When calling Alibaba Cloud OpenAPI, it is necessary to look up API names, assemble request parameters, and handle pagination and cross-region calls. OpenAPI MCP Server Core Edition (hereinafter “Core Edition”) provides 15 built-in tools that enable API calls, multi-step orchestration, Terraform resource management, and documentation search through natural language. It is compatible with common AI Agents (e.g., Qoder, Claude Code, CodeX). The following describes the function, parameters, and usage of each tool.
Prerequisites
Core Edition MCP Server configuration and integration has been completed. For details, see OpenAPI MCP Server.
Verify the MCP connection. Enter “List Alibaba Cloud compute-related products” in the AI Agent conversation. If a product list is returned, the connection is working properly.
Tool Overview
Core Edition includes 15 tools, categorized into the following five groups:
Category | Tool | Description |
API Discovery | List all Alibaba Cloud products and metadata | |
List all APIs under a specified product | ||
Get complete parameter definitions of an API | ||
Recommend matching OpenAPI based on natural language description | ||
List regions supported by a product | ||
API Execution | Generate CLI command (without executing) | |
Execute Alibaba Cloud CLI command | ||
Advanced Orchestration | Execute Python scripts with multi-API orchestration | |
Poll asynchronous task status | ||
Infrastructure as Code | Generate OSS presigned URL | |
Execute Terraform HCL code | ||
Document Search | Search documentation | |
Get document Markdown content | ||
Browse product document directory tree | ||
Match document content by keyword |
Tool Details
API Discovery
ListProducts
When it is necessary to learn which Alibaba Cloud products are available, the AI Agent uses this tool to query the product catalog. For example, entering “What compute-related products does Alibaba Cloud have” causes the AI Agent to extract keywords and filter the product list accordingly.
Usage Guidance
Specify product keywords in the description. For example, “What compute-related products does Alibaba Cloud have” is better than “What products does Alibaba Cloud have”.
Query results can serve as context for subsequent conversations. For example, first ask “What database products are available”, then follow up with specific operational details for a particular product.
ListApis
When a user operation involves a specific product but the AI Agent needs to confirm the exact API operation, this tool is used to browse the product API list. For example, entering “Allocate a public IP to an ECS instance” may cause the AI Agent to first query which ECS APIs are relevant, then select the appropriate one to execute.
Usage Guidance
Be as specific as possible about the product and action when describing operational intent. For example, “allocate a public IP to an ECS instance” is better than “allocate IP”.
GetApiDefinition
When a user request involves an API call, the AI Agent typically first locates the target API through SearchApis or ListApis, then uses this tool to get the API parameter definitions, and finally constructs the correct call. For example, entering “Query ECS instances in Hangzhou region” causes the AI Agent to first locate the DescribeInstances API, then confirm the required parameters through this tool before executing.
Usage Guidance
Be as specific as possible when describing operational intent. Once the AI Agent locates the correct API, it automatically confirms parameters and executes.
SearchApis
When the exact API name is unknown, the AI Agent uses this tool to match the corresponding Alibaba Cloud OpenAPI based on a natural language description. For example, entering “How to view ECS instance monitoring data” causes the AI Agent to search and find relevant monitoring APIs.
Usage Guidance
Include the product name in the description. For example, “query ECS security group rules” is better than “query security groups”.
Break complex requirements into multiple independent questions, each corresponding to a single API operation.
When the API name is already known, specify it directly to the AI Agent (e.g., “use DescribeInstances to query”) to skip the search step.
ListProductRegions
When an operation involves region selection, the AI Agent uses this tool to confirm whether the target region supports the product. For example, entering “Can ECS be used in Ulanqab” or “Create an ECS instance in Singapore” causes the AI Agent to first verify region availability.
Usage Guidance
Specify both the product name and target region in the query. For example, “Can ECS be used in Ulanqab” is better than “Can it be used in Ulanqab”.
When multiple regions are involved, specify each one. For example, “Confirm whether ECS is available in Hangzhou, Shanghai, and Singapore”.
API Execution
GenerateCLICommand
When instructed to “only generate the command without executing” or when the AI Agent needs to preview a command, this tool generates a CLI command string. The AI Agent typically first confirms parameters through GetApiDefinition, then generates the command through this tool, and finally executes it via CallCLI. For example, entering “Generate a command to query ECS instances in Hangzhou” returns a complete command that can be executed in a local terminal.
Usage Guidance
To manually execute a command in the local terminal, request the AI Agent to “only generate the command without executing.” The generated command can be copied and used directly.
CallCLI
When the AI Agent knows exactly which API operation to execute, this tool is used to make the call directly. This is the primary tool for API calls in Core Edition. For example, entering “Query running ECS instances in Hangzhou region” causes the AI Agent to construct a CLI command and execute the query.
Usage Guidance
CLI commands executed by this tool run on a remote server and cannot read local files.
Write operations (create, modify, or delete resources) may incur charges. Request the AI Agent to confirm the operation content before execution.
Advanced Orchestration
RunScript
When a single API call cannot fulfill the requirement, the AI Agent uses this tool to write scripts for batch operations. For example, entering “Count ECS instances across all regions” or “Check all security groups for high-risk rules” causes the AI Agent to write concurrent scripts to query multiple resources simultaneously.
Usage Guidance
When aggregation, comparison, or batch operations are needed, clearly describe the scope and objective. For example, “Count ECS instances across all regions” or “Check all security groups for high-risk rules”.
Script execution may take seconds to tens of seconds. Wait patiently for the result to return.
GetTask
When a RunScript or RunIaC task takes a long time to execute, the AI Agent uses this tool to wait for task completion and retrieve the result. This tool may be triggered during time-consuming operations such as cross-region inspection or Terraform deployment.
Usage Guidance
For time-consuming operations (such as cross-region inspection or batch queries), wait patiently for the result to return.
If manual approval is required, complete the approval process as prompted and the result will continue to return.
Infrastructure as Code
GetPresignedUrl
When RunIaC or RunScript tools need to reference external files, the AI Agent uses this tool to generate a temporary upload link. For example, when Terraform code exceeds 64 KB or a script needs to process pre-uploaded data files, the AI Agent first uploads the file through this tool before executing subsequent operations.
Usage Guidance
When large file uploads are involved, it may be necessary to wait for the upload to complete before executing subsequent operations.
RunIaC
When cloud resources need to be created, modified, or destroyed, the AI Agent may use this tool to manage infrastructure via Terraform. For example, entering “Create a VPC in Hangzhou with CIDR 172.16.0.0/16” causes the AI Agent to first generate the resource configuration and preview the changes, then execute the creation after confirmation.
Usage Guidance
When describing resource requirements, specify the region, specifications, and naming clearly. For example, “Create a VPC in Hangzhou with CIDR 172.16.0.0/16, named mcp-demo-vpc”.
Resource changes may require manual approval. Complete the approval process as prompted.
Document Search
SearchDocuments
When a knowledge-based question about product usage, configuration methods, or error troubleshooting is asked, the AI Agent uses this tool to search Alibaba Cloud official documentation. For example, entering “How to optimize Function Compute cold start” or “How to configure OSS Bucket Policy” triggers a search for matching official documents.
Usage Guidance
Including the product name in the query improves search result relevance. For example, “OSS cross-origin configuration” is better than “cross-origin configuration”.
When documentation for a specific product is needed, specify the product name. For example, “Function Compute cold start optimization documentation” is better than “cold start optimization”.
GetDocument
After the AI Agent locates relevant documents through SearchDocuments, this tool is used to read the full content to answer the question. For example, entering “How to optimize Function Compute cold start?” causes the AI Agent to first search and locate the document, then read the full text and organize the answer.
Usage Guidance
The AI Agent automatically reads and organizes the content after locating documents. The entire process is transparent to the user.
GetDocumentTree
When a user wants to understand the documentation structure of a product, the AI Agent uses this tool to browse the document directory tree. For example, entering “What does the OSS documentation structure look like” or “What user guides does ECS have”.
Usage Guidance
Specify the product name in the query. For example, “What document categories does OSS have” or “What chapters are under the ECS user guide”.
GrepDocuments
When a question involves specific terms, configuration items, or error codes, the AI Agent uses this tool to perform exact keyword matching within a specified product documentation. For example, entering “What values does InstanceChargeType have in ECS documentation” or “Search for CORS-related content in OSS documentation”.
Usage Guidance
Specify both the product and keyword in the query. For example, “Search for DescribeInstanceAttribute in ECS documentation”.
More precise keywords yield more relevant results. Multiple keywords have an AND relationship.
Typical Use Cases
The following scenarios demonstrate complete workflows where multiple tools collaborate to accomplish complex tasks.
Query Security Group Rules
User input:
Check the security group rules in the Hangzhou regionPossible AI Agent tool call chain:
Uses
SearchApisto search “Query security group rules associated with ECS instances”, locating the DescribeSecurityGroupAttribute API (confidence 0.98).Uses
GetApiDefinitionto confirm the API requires SecurityGroupId and RegionId as mandatory parameters.Uses
CallCLIto execute the query, returning the security group rule list (including direction, protocol, port range, source address, etc.).
Tools involved: SearchApis, GetApiDefinition, CallCLI
Cross-Region Batch Inspection
User input:
Count the number of ECS instances in Hangzhou, Shanghai, and Beijing regionsPossible AI Agent tool call chain:
Uses
RunScriptto write a concurrent script that queries instance counts across all three regions simultaneously.Script execution times out (exceeds 20 seconds), returning a processID.
Uses
GetTaskto poll the task status and retrieve the result after script execution completes.
Tools involved: RunScript, GetTask
Solve Problems Using Documentation
User input:
Function Compute cold start latency is high. What optimization options are available?Possible AI Agent tool call chain:
Uses
SearchDocumentsto search “Function Compute cold start optimization”, finding the “Best Practices for Function Compute Cold Start Optimization” document (doc_id: 2513659).Uses
GetDocumentto read the full document text and retrieve cold start definitions and optimization strategies.Uses
GetDocumentTreeto browse the Function Compute document directory and identify additional performance-related documentation chapters.
Tools involved: SearchDocuments, GetDocument, GetDocumentTree