Skip to main content
Glama

list_ecs_services

Retrieve services within an ECS cluster to monitor and manage containerized applications in AWS.

Instructions

Lists services in a specific ECS cluster.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
clusterYesThe name or ARN of the ECS cluster.

Implementation Reference

  • Handler function that lists ECS services in the specified cluster. Uses ListServicesCommand to get service ARNs, then DescribeServicesCommand for details like status, counts, and task definition. Limits to first 10 services.
    const cluster = (args as any).cluster; const command = new ListServicesCommand({ cluster }); const response = await ecsClient.send(command); const services = response.serviceArns || []; if (services.length === 0) return { content: [{ type: "text", text: "[]" }] }; // Describe for more info const batch = services.slice(0, 10); const descCommand = new DescribeServicesCommand({ cluster, services: batch }); const descResponse = await ecsClient.send(descCommand); const serviceDetails = descResponse.services?.map(s => ({ serviceName: s.serviceName, status: s.status, desiredCount: s.desiredCount, runningCount: s.runningCount, pendingCount: s.pendingCount, taskDefinition: s.taskDefinition })) || []; return { content: [{ type: "text", text: JSON.stringify(serviceDetails, null, 2) }] }; }
  • src/index.ts:722-731 (registration)
    Tool registration in the ListToolsRequestSchema response array, defining the tool name, description, and input schema requiring a 'cluster' parameter.
    description: "Lists services in a specific ECS cluster.", inputSchema: { type: "object", properties: { cluster: { "type": "string", "description": "The name or ARN of the ECS cluster." } }, required: ["cluster"] } }, {
  • Input schema for the list_ecs_services tool, specifying an object with a required 'cluster' string parameter.
    type: "object", properties: { cluster: { "type": "string", "description": "The name or ARN of the ECS cluster." } }, required: ["cluster"] } },
  • Import of ECSClient and relevant commands (ListServicesCommand, DescribeServicesCommand) used by the list_ecs_services handler.
    import { ECSClient, ListClustersCommand, ListServicesCommand, DescribeClustersCommand, DescribeServicesCommand } from "@aws-sdk/client-ecs";
  • Initialization of the shared ECSClient instance used by the handler.
    const ecsClient = new ECSClient({});

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