Skip to main content
Glama

list_ecs_clusters

Retrieve a list of Amazon ECS clusters with their current status and running task counts for monitoring and management.

Instructions

Lists ECS clusters with their status and running task counts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that implements the list_ecs_clusters tool logic using ECSClient, ListClustersCommand, and DescribeClustersCommand to list clusters with status and task counts.
    if (name === "list_ecs_clusters") { const command = new ListClustersCommand({}); const response = await ecsClient.send(command); // Detail describe to get task counts const clusters = response.clusterArns || []; if (clusters.length === 0) return { content: [{ type: "text", text: "[]" }] }; const descParams = { clusters: clusters }; const descCommand = new DescribeClustersCommand(descParams); const descResponse = await ecsClient.send(descCommand); const clusterDetails = descResponse.clusters?.map(c => ({ clusterName: c.clusterName, status: c.status, runningTasksCount: c.runningTasksCount, pendingTasksCount: c.pendingTasksCount, activeServicesCount: c.activeServicesCount })) || []; return { content: [{ type: "text", text: JSON.stringify(clusterDetails, null, 2) }] }; }
  • src/index.ts:716-719 (registration)
    Registration of the 'list_ecs_clusters' tool in the ListToolsRequestSchema handler, including its description and input schema (no parameters).
    name: "list_ecs_clusters", description: "Lists ECS clusters with their status and running task counts.", inputSchema: { "type": "object", "properties": {} } },
  • Input schema definition for the list_ecs_clusters tool (empty object, no required parameters).
    inputSchema: { "type": "object", "properties": {} }
  • Initialization of the ECSClient instance used by the list_ecs_clusters handler.
    const ecsClient = new ECSClient({});
  • Import of necessary AWS SDK classes for ECS operations, including those used by list_ecs_clusters.
    import { ECSClient, ListClustersCommand, ListServicesCommand, DescribeClustersCommand, DescribeServicesCommand } from "@aws-sdk/client-ecs";

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/Bhavesh8890/MCP-server'

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