rds_list_instances
Retrieve a list of RDS instances in your Alibaba Cloud account, optionally filtered by region.
Instructions
List RDS instances.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| regionId | No |
Implementation Reference
- src/tools/rds/index.ts:20-38 (handler)The handleRdsTools function handles 'rds_list_instances' by creating an Alibaba Cloud RDS client and calling DescribeDBInstances API with the provided regionId (defaulting to config region). Returns JSON-stringified list of instances.
export async function handleRdsTools(name: string, args: any) { // @ts-ignore const client = new Core.default({ accessKeyId: config.ALIBABA_CLOUD_ACCESS_KEY_ID, accessKeySecret: config.ALIBABA_CLOUD_ACCESS_KEY_SECRET, endpoint: 'https://rds.aliyuncs.com', apiVersion: '2014-08-15', }); if (name === "rds_list_instances") { const parsed = z.object({ regionId: z.string().default(config.ALIBABA_CLOUD_REGION_ID) }).parse(args); return { content: [{ type: "text", text: JSON.stringify(await client.request('DescribeDBInstances', { RegionId: parsed.regionId }, { method: 'POST' }), null, 2) }] }; } throw new Error(`Unknown RDS tool: ${name}`); } - src/tools/rds/index.ts:5-18 (schema)registerRdsTools defines the input schema for 'rds_list_instances': an object with an optional 'regionId' string property.
export function registerRdsTools() { return [ { name: "rds_list_instances", description: "List RDS instances.", inputSchema: { type: "object", properties: { regionId: { type: "string" } } } } ]; } - src/index.ts:31-43 (registration)The server registers the tool via ListToolsRequestSchema handler, spreading registerRdsTools() into the tools array.
server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: [ ...registerUniversalTool(), ...registerEcsTools(), ...registerVpcTools(), ...registerRdsTools(), ...registerRamTools(), ...registerAckTools(), ...registerSlbTools() ], }; }); - src/index.ts:60-62 (registration)The CallToolRequestSchema handler routes tool calls starting with 'rds_' to handleRdsTools().
if (name.startsWith("rds_")) { return await handleRdsTools(name, args); }