get_assessment_log_output
Retrieve raw logs from Terraform Cloud assessment operations to analyze execution details and errors. Requires workspace admin access, providing direct log output for troubleshooting.
Instructions
Retrieve logs from an assessment result.
Gets the raw log output from a Terraform Cloud assessment operation, providing detailed information about the execution and any errors.
API endpoint: GET /api/v2/assessment-results/{assessment_result_id}/log-output
Args: assessment_result_id: The ID of the assessment result to retrieve logs for (format: "asmtres-xxxxxxxx")
Returns: The raw logs from the assessment operation. The redirect to the log file is automatically followed.
Note: This endpoint requires admin level access to the workspace and cannot be accessed with organization tokens.
See: docs/tools/assessment_results.md for reference documentation
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| assessment_result_id | Yes |
Implementation Reference
- The handler function that executes the tool logic: validates input with AssessmentOutputRequest and fetches log output via API.@handle_api_errors async def get_assessment_log_output(assessment_result_id: str) -> APIResponse: """Retrieve logs from an assessment result. Gets the raw log output from a Terraform Cloud assessment operation, providing detailed information about the execution and any errors. API endpoint: GET /api/v2/assessment-results/{assessment_result_id}/log-output Args: assessment_result_id: The ID of the assessment result to retrieve logs for (format: "asmtres-xxxxxxxx") Returns: The raw logs from the assessment operation. The redirect to the log file is automatically followed. Note: This endpoint requires admin level access to the workspace and cannot be accessed with organization tokens. See: docs/tools/assessment_results.md for reference documentation """ # Validate parameters params = AssessmentOutputRequest(assessment_result_id=assessment_result_id) # Make API request with text acceptance for the logs return await api_request( f"assessment-results/{params.assessment_result_id}/log-output", accept_text=True )
- terraform_cloud_mcp/server.py:110-110 (registration)Registers the get_assessment_log_output tool in the MCP server.mcp.tool()(assessment_results.get_assessment_log_output)