repair_cost
Estimate home repair costs by entering repair type and zip code to get accurate pricing information for planning and budgeting.
Instructions
Get repair cost estimate for home repairs
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repair_type | Yes | ||
| zip_code | Yes |
Implementation Reference
- server.py:31-49 (handler)The 'repair_cost' tool handler, registered via @mcp.tool() decorator in the FastMCP server. Handles fetching repair cost estimates from an external API using repair_type and zip_code parameters.@mcp.tool() def repair_cost(repair_type: str, zip_code: str) -> str: """Get repair cost estimate for home repairs""" try: repair_type=repair_type.replace(' ', '_') url = f"{REPAIR_API_BASE_URL}/api/v1/repair-cost/{repair_type}" headers = {"x-api-key": REPAIR_API_KEY} params = {"zip_code": zip_code, "scope": "comprehensive"} response = requests.get(url, headers=headers, params=params) response.raise_for_status() data = response.json() cost = data["cost_estimate"] return f"${cost['low']:,} - ${cost['high']:,} (avg: ${cost['average']:,}) for {repair_type.replace('_', ' ')} in {zip_code}" except Exception as e: return f"Error: {str(e)}"