get_account_details
Retrieve authenticated user or service account details from Terraform Cloud, including identity verification, email address, and authentication status.
Instructions
Get account details for a Terraform Cloud API token
This endpoint shows information about the currently authenticated user or service account, useful for verifying identity, retrieving email address, and checking authentication status. It returns the same type of object as the Users API, but also includes an email address, which is hidden when viewing info about other users.
API endpoint: GET /account/details
Returns: Raw API response with account information from Terraform Cloud including user ID, username, email address, and authentication status
See: docs/tools/account.md for reference documentation
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- The main handler function decorated with error handling that performs the API request to retrieve account details from Terraform Cloud.@handle_api_errors async def get_account_details() -> APIResponse: """Get account details for a Terraform Cloud API token This endpoint shows information about the currently authenticated user or service account, useful for verifying identity, retrieving email address, and checking authentication status. It returns the same type of object as the Users API, but also includes an email address, which is hidden when viewing info about other users. API endpoint: GET /account/details Returns: Raw API response with account information from Terraform Cloud including user ID, username, email address, and authentication status See: docs/tools/account.md for reference documentation """ return await api_request("account/details")
- terraform_cloud_mcp/server.py:50-50 (registration)Tool registration in the MCP server using mcp.tool() decorator on the imported get_account_details function.mcp.tool()(account.get_account_details)
- Pydantic schema/model for the account details request (empty since no input parameters required).class AccountDetailsRequest(APIRequest): """Request model for getting account details. This model is used for the GET /account/details endpoint which requires no parameters. The endpoint returns information about the currently authenticated user or service account. Reference: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/account#show-account-details Note: For team and organization tokens, this endpoint returns information about a synthetic "service user" account associated with the token. See: docs/models/account.md for reference """ pass # No parameters needed for this endpoint