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;
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool 'searches for properties', implying a read-only operation, but doesn't cover critical aspects like authentication needs, rate limits, pagination, error handling, or what 'comprehensive property information' entails. This leaves significant gaps for an agent to understand how to use it effectively.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise with two sentences that efficiently convey the core functionality. It's front-loaded with the main purpose. However, the phrase 'comprehensive property information' is vague and could be more specific to improve clarity without adding length.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description is incomplete for a tool with 4 parameters and complex search functionality. It lacks details on return values (e.g., format, fields), error cases, and behavioral constraints like rate limits or authentication, which are essential for an agent to use it correctly in context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents all four parameters (city, limit, state, zipCode). The description adds no additional parameter semantics beyond what's in the schema, such as how parameters interact or search logic. Baseline 3 is appropriate when the schema handles parameter documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('Get') and resource ('rental listings'), and distinguishes it from sale listings by specifying 'for rent'. However, it doesn't explicitly differentiate from sibling tools like 'search_properties' or 'get_random_properties', which might also retrieve rental listings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for searching rental properties, but provides no explicit guidance on when to use this tool versus alternatives like 'search_properties' or 'get_sale_listings'. It mentions 'currently for rent', which gives some context, but lacks clear when/when-not instructions or named alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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