Skip to main content
Glama
tandat8503

Rentcast MCP Server

by tandat8503

get_rental_listings

Search for available rental properties with comprehensive details by location. Find current rental listings using city, state, or ZIP code parameters to access property information for housing searches.

Instructions

Get rental listings with comprehensive property information. This tool searches for properties currently for rent.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cityNoCity for listing search (e.g., 'Austin', 'New York', 'Los Angeles')
limitNoMaximum number of listings to return (default: 15, max: 50 for free tier)
stateNoState for listing search (e.g., 'TX', 'NY', 'CA')
zipCodeNoZIP code for listing search (e.g., '78705', '10001', '90210')

Implementation Reference

  • The complete MCP tool registration and handler function for 'get_rental_listings'. It builds search parameters, calls the Rentcast API via rentcastAPI.getRentalListings, processes listings with formatPropertyInfo, and returns formatted results.
    server.tool( "get_rental_listings", "Get rental listings with comprehensive property information. This tool searches for properties currently for rent.", ListingSearchSchema.shape, async (params) => { try { const searchParams = buildPropertySearchParams(params); const result = await rentcastAPI.getRentalListings(searchParams); if (!result.success) { return createErrorResponse("Error getting rental listings", result.error); } const listings = result.data as any[]; const summary = `Found ${listings.length} rental listings`; const listingDetails = listings.slice(0, 8).map(listing => { // Use actual Rentcast API data structure const propertyInfo = formatPropertyInfo(listing); // Add compact parameter suggestions const params = `\n💡 **Quick Parameters:** Address: "${listing.formattedAddress}", Lat: ${listing.latitude}, Lng: ${listing.longitude}, Type: "${listing.propertyType}", Beds: ${listing.bedrooms || 'N/A'}, Baths: ${listing.bathrooms || 'N/A'}, SqFt: ${listing.squareFootage || 'N/A'}`; return propertyInfo + params; }).join('\n\n'); const resultText = `${summary}\n\n${listingDetails}${listings.length > 8 ? '\n\n... and more listings available' : ''}`; return createSuccessResponse(resultText); } catch (error) { return createErrorResponse("Failed to get rental listings", error instanceof Error ? error.message : 'Unknown error'); } } );
  • Zod schema defining the input parameters for the get_rental_listings tool: city, state, zipCode (optional), limit (1-50, default 15).
    export const ListingSearchSchema = z.object({ city: z.string().optional().describe("City for listing search (e.g., 'Austin', 'New York', 'Los Angeles')"), state: z.string().optional().describe("State for listing search (e.g., 'TX', 'NY', 'CA')"), zipCode: z.string().optional().describe("ZIP code for listing search (e.g., '78705', '10001', '90210')"), limit: z .number() .min(1) .max(50) .default(15) .describe( "Maximum number of listings to return (default: 15, max: 50 for free tier)", ), });
  • Rentcast API service helper method that performs the HTTP GET request to the '/listings/rental/long-term' endpoint with search parameters.
    async getRentalListings( params: { city?: string; state?: string; zipCode?: string; limit?: number; } = {}, ): Promise<ApiCallResult> { const result = await this.makeRequest<RentcastListing[]>( "/listings/rental/long-term", { ...params, limit: params.limit || 15, // Default to 15 for free tier optimization }, ); return result; }
  • Utility helper function used to construct search parameters from tool inputs for get_rental_listings and similar tools.
    function buildPropertySearchParams(params: any, includeLimit: boolean = true): any { const searchParams: any = {}; if (includeLimit && params.limit) { searchParams.limit = params.limit; } if (params.city) searchParams.city = params.city; if (params.state) searchParams.state = params.state; if (params.zipCode) searchParams.zipCode = params.zipCode; if (params.bedrooms) searchParams.bedrooms = params.bedrooms; if (params.bathrooms) searchParams.bathrooms = params.bathrooms; if (params.propertyType) searchParams.propertyType = params.propertyType; return searchParams; }

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