get_instance_details
Retrieve detailed information about a specific EC2 instance to monitor its status, configuration, and resource usage within AWS environments.
Instructions
Retrieves detailed information about a specific EC2 instance.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| instance_id | Yes | The ID of the EC2 instance. |
Implementation Reference
- src/index.ts:1328-1340 (handler)Handler that retrieves detailed EC2 instance information using DescribeInstancesCommand and returns it as JSON.if (name === "get_instance_details") { const instanceId = (args as any).instance_id; const command = new DescribeInstancesCommand({ InstanceIds: [instanceId] }); const response = await ec2Client.send(command); const instance = response.Reservations?.[0]?.Instances?.[0]; if (!instance) { return { content: [{ type: "text", text: "Instance not found." }] }; } return { content: [{ type: "text", text: JSON.stringify(instance, null, 2) }] }; }
- src/index.ts:283-293 (registration)Tool registration in ListToolsRequestSchema handler, defining name, description, and input schema for get_instance_details.{ name: "get_instance_details", description: "Retrieves detailed information about a specific EC2 instance.", inputSchema: { type: "object", properties: { instance_id: { type: "string", description: "The ID of the EC2 instance." } }, required: ["instance_id"] } },
- src/index.ts:286-292 (schema)JSON schema for input validation: requires 'instance_id' string.inputSchema: { type: "object", properties: { instance_id: { type: "string", description: "The ID of the EC2 instance." } }, required: ["instance_id"] }