list-credentials
Retrieve all configured AWS credentials, configs, and profiles accessible on your machine. Simplify AWS resource management by identifying usable credentials directly.
Instructions
List all AWS credentials/configs/profiles that are configured/usable on this machine
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- index.ts:80-89 (registration)Registration of the 'list-credentials' tool in the ListTools response, including name, description, and empty input schema.{ name: "list-credentials", description: "List all AWS credentials/configs/profiles that are configured/usable on this machine", inputSchema: { type: "object", properties: {}, required: [], }, },
- index.ts:164-167 (handler)Handler for executing the 'list-credentials' tool, serializes and returns the list of available AWS profiles.} else if (name === "list-credentials") { return createTextResponse( JSON.stringify({ profiles: Object.keys(profiles), error }) );
- index.ts:214-232 (helper)Helper function that loads AWS credentials and configuration profiles using AWS.IniLoader, merging them and handling errors.async function listCredentials() { let credentials: any; let configs: any; let error: any; try { credentials = new AWS.IniLoader().loadFrom({}); } catch (error) { error = `Failed to load credentials: ${error}`; } try { configs = new AWS.IniLoader().loadFrom({ isConfig: true }); } catch (error) { error = `Failed to load configs: ${error}`; } const profiles = { ...(credentials || {}), ...(configs || {}) }; return { profiles, error }; }