get_aws_caller_identity
Verify AWS IAM credentials by returning the current caller identity (user or role) to confirm authentication status.
Instructions
Returns the AWS IAM caller identity (user/role) to verify credentials.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:791-810 (handler)The handler logic for the 'get_aws_caller_identity' tool. It uses the STSClient to send a GetCallerIdentityCommand and returns the AWS account, UserId, and ARN as JSON.if (name === "get_aws_caller_identity") { const command = new GetCallerIdentityCommand({}); const response = await stsClient.send(command); return { content: [ { type: "text", text: JSON.stringify( { UserId: response.UserId, Account: response.Account, Arn: response.Arn, }, null, 2 ), }, ], }; }
- src/index.ts:97-104 (registration)Tool registration in the ListToolsRequestSchema handler, defining the tool name, description, and empty input schema (no parameters required).{ name: "get_aws_caller_identity", description: "Returns the AWS IAM caller identity (user/role) to verify credentials.", inputSchema: { type: "object", properties: {}, }, },
- src/index.ts:100-103 (schema)Input schema for the tool: an empty object, indicating no input parameters are needed.inputSchema: { type: "object", properties: {}, },
- src/index.ts:54-54 (helper)Instantiation of the STSClient used by the get_aws_caller_identity handler.const stsClient = new STSClient({});
- src/index.ts:20-20 (helper)Import of STSClient and GetCallerIdentityCommand required for the tool implementation.import { STSClient, GetCallerIdentityCommand } from "@aws-sdk/client-sts";