Skip to main content
Glama
code-alchemist01

MCP Cloud Services Server

list_resources

List cloud resources across AWS, Azure, or GCP to view instances, storage, databases, or functions. Filter by provider, type, and region to manage multi-cloud infrastructure.

Instructions

List cloud resources (instances, storage, databases, functions) across AWS, Azure, or GCP

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
providerYesCloud provider
typeNoResource type to listall
regionNoRegion to filter resources

Implementation Reference

  • The core handler logic for the 'list_resources' tool. It parses input parameters, selects the cloud provider adapter (AWS, Azure, or GCP), lists specified resource types (instances, storage, databases, functions), and returns a structured object with the results.
    case 'list_resources': { const resourceType = (params.type as string) || 'all'; const region = params.region as string; if (provider === 'aws') { const adapter = new AWSAdapter(region); const results: Record<string, unknown[]> = {}; if (resourceType === 'all' || resourceType === 'instance') { results.instances = await adapter.listEC2Instances(); } if (resourceType === 'all' || resourceType === 'storage') { results.storage = await adapter.listS3Buckets(); } if (resourceType === 'all' || resourceType === 'function') { results.functions = await adapter.listLambdaFunctions(); } if (resourceType === 'all' || resourceType === 'database') { results.databases = await adapter.listRDSInstances(); } return results; } else if (provider === 'azure') { const adapter = new AzureAdapter(undefined, region); const results: Record<string, unknown[]> = {}; if (resourceType === 'all' || resourceType === 'instance') { results.instances = await adapter.listVirtualMachines(); } if (resourceType === 'all' || resourceType === 'storage') { results.storage = await adapter.listStorageAccounts(); } return results; } else if (provider === 'gcp') { const adapter = new GCPAdapter(undefined, region); const results: Record<string, unknown[]> = {}; if (resourceType === 'all' || resourceType === 'instance') { results.instances = await adapter.listComputeInstances(); } if (resourceType === 'all' || resourceType === 'storage') { results.storage = await adapter.listStorageBuckets(); } if (resourceType === 'all' || resourceType === 'function') { results.functions = await adapter.listCloudFunctions(); } return results; } throw new Error(`Unsupported provider: ${provider}`); }
  • The tool definition including name, description, and inputSchema for validation of parameters (provider required, type and region optional).
    { name: 'list_resources', description: 'List cloud resources (instances, storage, databases, functions) across AWS, Azure, or GCP', inputSchema: { type: 'object', properties: { provider: { type: 'string', enum: ['aws', 'azure', 'gcp'], description: 'Cloud provider', }, type: { type: 'string', enum: ['instance', 'storage', 'database', 'function', 'all'], description: 'Resource type to list', default: 'all', }, region: { type: 'string', description: 'Region to filter resources', }, }, required: ['provider'], }, },
  • src/server.ts:19-27 (registration)
    The 'resourceManagementTools' array (containing 'list_resources') is spread into 'allTools', which is returned by the MCP listTools handler to advertise available tools.
    const allTools = [ ...awsTools, ...azureTools, ...gcpTools, ...resourceManagementTools, ...costAnalysisTools, ...monitoringTools, ...securityTools, ];
  • src/server.ts:70-71 (registration)
    Dispatch logic in the MCP callTool handler that routes 'list_resources' calls (matched via resourceManagementTools) to the handleResourceManagementTool function.
    } else if (resourceManagementTools.some((t) => t.name === name)) { result = await handleResourceManagementTool(name, args || {});

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/code-alchemist01/Cloud-mcp_server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server