Skip to main content
Glama
tandat8503

Rentcast MCP Server

by tandat8503

get_rent_estimates

Estimate monthly rental prices for properties using location details, property characteristics, and market data to determine fair market rent values.

Instructions

Get long-term rent estimates with comparable rental properties. This tool helps you estimate monthly rental prices for properties based on location, property characteristics, and market data.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressNoFull property address (e.g., '1011 W 23rd St, Apt 101, Austin, TX 78705')
bathroomsNoNumber of bathrooms (e.g., 1, 1.5, 2)
bedroomsNoNumber of bedrooms (e.g., 1, 2, 3)
latitudeNoProperty latitude coordinate (e.g., 30.287007)
longitudeNoProperty longitude coordinate (e.g., -97.748941)
propertyIdNoUnique property identifier from Rentcast database (e.g., '12345')
propertyTypeNoType of property (e.g., 'Apartment', 'House', 'Condo', 'Townhouse')
squareFootageNoProperty size in square feet (e.g., 450, 1200, 2000)

Implementation Reference

  • Primary MCP server tool registration and handler for 'get_rent_estimates'. Validates input parameters using RentEstimateSchema, builds API request params, calls rentcastAPI.getRentEstimates(), processes the response data including comparables, formats a comprehensive user-friendly output with estimates, ranges, and suggestions.
    server.tool( "get_rent_estimates", "Get long-term rent estimates with comparable rental properties. This tool helps you estimate monthly rental prices for properties based on location, property characteristics, and market data.", RentEstimateSchema.shape, async (params: z.infer<typeof RentEstimateSchema>) => { try { // Validate parameters using Zod schema const validatedParams = RentEstimateSchema.parse(params); // Build search parameters for rent estimates const searchParams: Record<string, any> = {}; if (validatedParams.propertyId) searchParams.propertyId = validatedParams.propertyId; if (validatedParams.address) searchParams.address = validatedParams.address; if (validatedParams.latitude) searchParams.latitude = validatedParams.latitude; if (validatedParams.longitude) searchParams.longitude = validatedParams.longitude; if (validatedParams.propertyType) searchParams.propertyType = validatedParams.propertyType; if (validatedParams.bedrooms) searchParams.bedrooms = validatedParams.bedrooms; if (validatedParams.bathrooms) searchParams.bathrooms = validatedParams.bathrooms; if (validatedParams.squareFootage) searchParams.squareFootage = validatedParams.squareFootage; // Additional validation to ensure we have required parameters if (!searchParams.propertyId && !searchParams.address && (!searchParams.latitude || !searchParams.longitude)) { return createErrorResponse( "❌ **Missing Required Parameters for Rent Estimates**\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\n\n" + "πŸ“‹ **Example Usage:**\n" + "```json\n" + "{\n" + ' "address": "1011 W 23rd St, Apt 101, Austin, TX 78705",\n' + ' "propertyType": "Apartment",\n' + ' "bedrooms": 1,\n' + ' "bathrooms": 1,\n' + ' "squareFootage": 450\n' + "}\n" + "```" ); } const result = await rentcastAPI.getRentEstimates(searchParams); if (!result.success) { return createErrorResponse("Error getting rent estimates", result.error); } const rentData = result.data as RentEstimateResponse; if (!rentData) { return createErrorResponse("No rent estimate data found"); } // Format the response let resultText = `🏠 **Rent Estimate Results**\n\n`; // Add usage tips resultText += `πŸ’‘ **Tool Usage Tips:**\n`; resultText += `β€’ Use this tool to estimate monthly rental prices for properties\n`; resultText += `β€’ Provide more details (bedrooms, bathrooms, square footage) for better accuracy\n`; resultText += `β€’ Results include comparable properties for market analysis\n\n`; // Property identification if (rentData.address) { resultText += `πŸ“ **Property:** ${rentData.address}\n`; } if (rentData.propertyType) { resultText += `🏠 **Type:** ${rentData.propertyType}\n`; } if (rentData.bedrooms !== undefined) { resultText += `πŸ›οΈ **Bedrooms:** ${rentData.bedrooms}\n`; } if (rentData.bathrooms !== undefined) { resultText += `🚿 **Bathrooms:** ${rentData.bathrooms}\n`; } if (rentData.squareFootage) { resultText += `πŸ“ **Square Footage:** ${rentData.squareFootage.toLocaleString()} sqft\n`; } resultText += `\nπŸ’° **Estimated Monthly Rent:** `; if (rentData.rent) { resultText += `$${Number(rentData.rent).toLocaleString()}/month`; // Add rent range if available if (rentData.rentRangeLow && rentData.rentRangeHigh) { resultText += `\nπŸ“Š **Rent Range:** $${Number(rentData.rentRangeLow).toLocaleString()} - $${Number(rentData.rentRangeHigh).toLocaleString()}/month`; } } else { resultText += `N/A`; } // Add comparables if available if (rentData.comparables && rentData.comparables.length > 0) { resultText += `\n\n🏘️ **Comparable Properties:**\n`; rentData.comparables.slice(0, 5).forEach((comp, index) => { resultText += `\n${index + 1}. **${comp.address}**\n`; resultText += ` πŸ’° Rent: $${Number(comp.rent).toLocaleString()}/month`; if (comp.bedrooms !== undefined) resultText += ` | πŸ›οΈ ${comp.bedrooms} bed`; if (comp.bathrooms !== undefined) resultText += ` | 🚿 ${comp.bathrooms} bath`; if (comp.squareFootage) resultText += ` | πŸ“ ${comp.squareFootage.toLocaleString()} sqft`; if (comp.distance) resultText += ` | πŸ“ ${comp.distance.toFixed(1)} miles away`; }); } // Add helpful footer resultText += `\n\nπŸ” **Need More Data?**\n`; resultText += `β€’ Use \`get_property_details\` to get comprehensive property information\n`; resultText += `β€’ Use \`get_rental_listings\` to see actual rental listings in the area\n`; resultText += `β€’ Use \`analyze_market\` to understand rental market trends\n\n`; return createSuccessResponse(resultText); } catch (error) { if (error instanceof z.ZodError) { const errorDetails = error.errors.map(e => `${e.path.join('.')}: ${e.message}`).join(', '); return createErrorResponse(`Invalid parameters: ${errorDetails}`); } return createErrorResponse("Failed to get rent estimates", error instanceof Error ? error.message : 'Unknown error'); } } );
  • Core service method implementing the Rentcast API call for long-term rent estimates. Makes authenticated GET request to '/avm/rent/long-term' endpoint with provided property parameters and returns ApiCallResult.
    async getRentEstimates( 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/rent/long-term", params, ); return result; }
  • Zod schema defining input parameters for the get_rent_estimates tool, including optional fields for property identification (propertyId, address, lat/lng) and characteristics (type, beds, baths, sqft) with descriptions.
    export const RentEstimateSchema = z.object({ // Required parameters (at least one) propertyId: z.string().optional().describe("Unique property identifier from Rentcast database (e.g., '12345')"), address: z.string().optional().describe("Full property address (e.g., '1011 W 23rd St, Apt 101, Austin, TX 78705')"), latitude: z.number().optional().describe("Property latitude coordinate (e.g., 30.287007)"), longitude: z.number().optional().describe("Property longitude coordinate (e.g., -97.748941)"), // Optional parameters for better accuracy propertyType: z.string().optional().describe("Type of property (e.g., 'Apartment', 'House', 'Condo', 'Townhouse')"), bedrooms: z.number().optional().describe("Number of bedrooms (e.g., 1, 2, 3)"), bathrooms: z.number().optional().describe("Number of bathrooms (e.g., 1, 1.5, 2)"), squareFootage: z.number().optional().describe("Property size in square feet (e.g., 450, 1200, 2000)"), });
  • TypeScript interface defining the expected response structure from the rent estimate API call, including estimated rent, range, comparables array, and echoed input parameters.
    export interface RentEstimateResponse { rent?: number; rentRangeLow?: number; rentRangeHigh?: number; comparables?: Array<{ address: string; rent: number; bedrooms?: number; bathrooms?: number; squareFootage?: number; propertyType?: string; distance?: number; }>; propertyId?: string; address?: string; latitude?: number; longitude?: number; propertyType?: string; bedrooms?: number; bathrooms?: number; squareFootage?: number; }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/tandat8503/mcp_rentcast'

If you have feedback or need assistance with the MCP directory API, please join our Discord server