get_property_value
Retrieve automated property value estimates with comparable properties using property details like address, bedrooms, and square footage.
Instructions
Get automated property value estimates with comparable properties
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| address | No | Property address for valuation | |
| bathrooms | No | Number of bathrooms | |
| bedrooms | No | Number of bedrooms | |
| latitude | No | Property latitude coordinate | |
| longitude | No | Property longitude coordinate | |
| propertyId | No | Property ID for valuation | |
| propertyType | No | Property type for valuation | |
| squareFootage | No | Property square footage |
Implementation Reference
- src/index.ts:456-513 (registration)Registration of the 'get_property_value' MCP tool, including inline handler that validates params, calls Rentcast API via helper, formats AVM results with comparables, and returns formatted response.server.tool( "get_property_value", "Get automated property value estimates with comparable properties", AVMSchema.shape, async (params: z.infer<typeof AVMSchema>) => { try { const searchParams = buildAVMSearchParams(params); // Additional validation to ensure we have required parameters if (!searchParams.propertyId && !searchParams.address && (!searchParams.latitude || !searchParams.longitude)) { return createErrorResponse( "❌ **Missing Required Parameters for Property Valuation**\n\n" + "💡 **You must provide ONE of the following options:**\n\n" + "**Option 1: Property Address**\n" + "• `address`: Full property address (e.g., '1011 W 23rd St, Apt 101, Austin, TX 78705')\n\n" + "**Option 2: GPS Coordinates**\n" + "• `latitude`: Property latitude (e.g., 30.287007)\n" + "• `longitude`: Property longitude (e.g., -97.748941)\n\n" + "**Option 3: Property ID**\n" + "• `propertyId`: Unique identifier from Rentcast database\n\n" + "🔍 **Optional Parameters (improve accuracy):**\n" + "• `propertyType`: Apartment, House, Condo, etc.\n" + "• `bedrooms`: Number of bedrooms\n" + "• `bathrooms`: Number of bathrooms\n" + "• `squareFootage`: Property size in sq ft" ); } const result = await rentcastAPI.getPropertyValue(searchParams); if (!result.success) { return createErrorResponse("Error getting property value", result.error); } const avm = result.data as any; if (!avm) { return createErrorResponse("No property value data found"); } let resultText = `💰 Estimated Value: ${avm.price ? `$${Number(avm.price).toLocaleString()}` : 'N/A'}`; const range = avm.priceRangeLow && avm.priceRangeHigh ? ` (Range: $${Number(avm.priceRangeLow).toLocaleString()} - $${Number(avm.priceRangeHigh).toLocaleString()})` : ''; resultText += `${range}`; if (avm.comparables && avm.comparables.length > 0) { resultText += formatComparables(avm.comparables); } return createSuccessResponse(resultText); } catch (error) { return createErrorResponse("Failed to get property value", error instanceof Error ? error.message : 'Unknown error'); } } );
- src/index.ts:460-513 (handler)Inline handler function for get_property_value tool: parameter validation, API call, response formatting with estimated value, price range, and comparable properties.async (params: z.infer<typeof AVMSchema>) => { try { const searchParams = buildAVMSearchParams(params); // Additional validation to ensure we have required parameters if (!searchParams.propertyId && !searchParams.address && (!searchParams.latitude || !searchParams.longitude)) { return createErrorResponse( "❌ **Missing Required Parameters for Property Valuation**\n\n" + "💡 **You must provide ONE of the following options:**\n\n" + "**Option 1: Property Address**\n" + "• `address`: Full property address (e.g., '1011 W 23rd St, Apt 101, Austin, TX 78705')\n\n" + "**Option 2: GPS Coordinates**\n" + "• `latitude`: Property latitude (e.g., 30.287007)\n" + "• `longitude`: Property longitude (e.g., -97.748941)\n\n" + "**Option 3: Property ID**\n" + "• `propertyId`: Unique identifier from Rentcast database\n\n" + "🔍 **Optional Parameters (improve accuracy):**\n" + "• `propertyType`: Apartment, House, Condo, etc.\n" + "• `bedrooms`: Number of bedrooms\n" + "• `bathrooms`: Number of bathrooms\n" + "• `squareFootage`: Property size in sq ft" ); } const result = await rentcastAPI.getPropertyValue(searchParams); if (!result.success) { return createErrorResponse("Error getting property value", result.error); } const avm = result.data as any; if (!avm) { return createErrorResponse("No property value data found"); } let resultText = `💰 Estimated Value: ${avm.price ? `$${Number(avm.price).toLocaleString()}` : 'N/A'}`; const range = avm.priceRangeLow && avm.priceRangeHigh ? ` (Range: $${Number(avm.priceRangeLow).toLocaleString()} - $${Number(avm.priceRangeHigh).toLocaleString()})` : ''; resultText += `${range}`; if (avm.comparables && avm.comparables.length > 0) { resultText += formatComparables(avm.comparables); } return createSuccessResponse(resultText); } catch (error) { return createErrorResponse("Failed to get property value", error instanceof Error ? error.message : 'Unknown error'); } } );
- src/types/index.ts:230-244 (schema)Zod schema (AVMSchema) defining input parameters for the get_property_value tool, including optional propertyId, address, lat/lng, and property characteristics.export const AVMSchema = z.object({ propertyId: z.string().optional().describe("Property ID for valuation"), address: z.string().optional().describe("Property address for valuation"), latitude: z.number().optional().describe("Property latitude coordinate"), longitude: z.number().optional().describe("Property longitude coordinate"), propertyType: z.string().optional().describe("Property type for valuation"), bedrooms: z.number().min(0).max(10).optional().describe("Number of bedrooms"), bathrooms: z .number() .min(0) .max(10) .optional() .describe("Number of bathrooms"), squareFootage: z.number().optional().describe("Property square footage"), });
- src/services/rentcast-api.ts:131-145 (helper)RentcastAPI helper method that makes the actual API request to '/avm/value' endpoint for property value estimation (AVM).async getPropertyValue( params: { propertyId?: string; address?: string; latitude?: number; longitude?: number; propertyType?: string; bedrooms?: number; bathrooms?: number; squareFootage?: number; } = {}, ): Promise<ApiCallResult> { const result = await this.makeRequest<RentcastAVM>("/avm/value", params); return result; }
- src/index.ts:229-251 (helper)buildAVMSearchParams helper: constructs search parameters for AVM calls, prioritizing address or coordinates or propertyId, and including optional characteristics.function buildAVMSearchParams(params: any): any { const searchParams: any = {}; // Prioritize address if provided, otherwise use other parameters if (params.address) { searchParams.address = params.address; } else if (params.latitude && params.longitude) { searchParams.latitude = params.latitude; searchParams.longitude = params.longitude; } else if (params.propertyId) { searchParams.propertyId = params.propertyId; } // Add additional parameters if available (these improve accuracy) if (params.propertyType) searchParams.propertyType = params.propertyType; if (params.bedrooms !== undefined && params.bedrooms !== null) searchParams.bedrooms = params.bedrooms; if (params.bathrooms !== undefined && params.bathrooms !== null) searchParams.bathrooms = params.bathrooms; if (params.squareFootage !== undefined && params.squareFootage !== null) searchParams.squareFootage = params.squareFootage; return searchParams; }