get_organization_details
Retrieve comprehensive organization details including settings, email, and config defaults for Terraform Cloud using a specific organization name via API endpoint.
Instructions
Get details for a specific organization
Retrieves comprehensive information about an organization including settings, email contact info, and configuration defaults.
API endpoint: GET /organizations/{organization}
Args: organization: The organization name to retrieve details for (required)
Returns: Organization details including name, email, settings and configuration
See: docs/tools/organization.md for reference documentation
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| organization | Yes |
Implementation Reference
- The main handler function that executes the get_organization_details tool logic, making an API request to retrieve organization details.@handle_api_errors async def get_organization_details(organization: str) -> APIResponse: """Get details for a specific organization Retrieves comprehensive information about an organization including settings, email contact info, and configuration defaults. API endpoint: GET /organizations/{organization} Args: organization: The organization name to retrieve details for (required) Returns: Organization details including name, email, settings and configuration See: docs/tools/organization.md for reference documentation """ request = OrganizationDetailsRequest(organization=organization) return await api_request(f"organizations/{request.organization}")
- Pydantic model defining the input schema (organization parameter validation) for the get_organization_details tool.class OrganizationDetailsRequest(APIRequest): """Request model for getting organization details. This model is used for the GET /organizations/{name} endpoint. The endpoint returns detailed information about an organization including its name, external ID, created date, and all organization-level settings. Reference: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/organizations#show-an-organization See: docs/models/organization.md for reference """ organization: str = Field( ..., # No alias needed as field name matches API field name description="The name of the organization to retrieve details for", min_length=3, pattern=r"^[a-z0-9][-a-z0-9_]*[a-z0-9]$", )
- terraform_cloud_mcp/server.py:75-75 (registration)Registration of the get_organization_details tool using the mcp.tool() decorator.mcp.tool()(organizations.get_organization_details)