Skip to main content
Glama
tandat8503

Rentcast MCP Server

by tandat8503

search_properties

Find rental and sale properties by filtering location, bedrooms, bathrooms, property type, and other key criteria to match specific housing requirements.

Instructions

Search for properties with basic property information (default: 15, max: 50 for free tier) including city, state, bedrooms, bathrooms, square footage, lot size, and year built. Note: Price data may not be available for all properties.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bathroomsNoNumber of bathrooms (e.g., 1, 1.5, 2)
bedroomsNoNumber of bedrooms (e.g., 1, 2, 3)
cityNoCity name for property search (e.g., 'Austin', 'New York')
limitNoMaximum number of properties to return (default: 15, max: 50 for free tier)
propertyTypeNoProperty type (e.g., 'Single Family', 'Condo', 'Townhouse')
stateNoState abbreviation (e.g., 'TX', 'CA', 'NY')
zipCodeNoZIP code for location-based search (e.g., '78705', '90210')

Implementation Reference

  • MCP tool handler for 'search_properties': builds search params, calls Rentcast API searchProperties, processes results, formats output using formatPropertyInfo, and returns formatted text response.
    async (params) => {
      try {
                const searchParams = buildPropertySearchParams(params);
          
    
          
          const result = await rentcastAPI.searchProperties(searchParams);
    
        if (!result.success) {
          return createErrorResponse("Error searching properties", result.error);
        }
    
        const properties = result.data as any[];
        
    
        
        const summary = `Found ${properties.length} properties`;
        
        // Process each property individually based on actual API structure
        const propertyDetails = properties.slice(0, 10).map(prop => {
          return formatPropertyInfo(prop);
        }).join('\n\n');
    
        const resultText = `${summary}\n\n${propertyDetails}${properties.length > 10 ? '\n\n... and more properties available' : ''}`;
        return createSuccessResponse(resultText);
    
            } catch (error) {
          return createErrorResponse("Failed to search properties", error instanceof Error ? error.message : 'Unknown error');
        }
    }
  • Zod schema defining input validation for search_properties tool parameters including city, state, zipCode, bedrooms, bathrooms, propertyType, and limit.
    export const PropertySearchSchema = z.object({
      city: z.string().optional().describe("City name for property search (e.g., 'Austin', 'New York')"),
      state: z.string().optional().describe("State abbreviation (e.g., 'TX', 'CA', 'NY')"),
      zipCode: z.string().optional().describe("ZIP code for location-based search (e.g., '78705', '90210')"),
      bedrooms: z.number().min(0).max(10).optional().describe("Number of bedrooms (e.g., 1, 2, 3)"),
      bathrooms: z
        .number()
        .min(0)
        .max(10)
        .optional()
        .describe("Number of bathrooms (e.g., 1, 1.5, 2)"),
      propertyType: z
        .string()
        .optional()
        .describe("Property type (e.g., 'Single Family', 'Condo', 'Townhouse')"),
      limit: z
        .number()
        .min(1)
        .max(50)
        .default(15)
        .describe(
          "Maximum number of properties to return (default: 15, max: 50 for free tier)",
        ),
    });
  • src/index.ts:329-363 (registration)
    MCP server.tool registration for 'search_properties' tool, specifying name, description, input schema, and handler function.
    server.tool(
      "search_properties",
      "Search for properties with basic property information (default: 15, max: 50 for free tier) including city, state, bedrooms, bathrooms, square footage, lot size, and year built. Note: Price data may not be available for all properties.",
      PropertySearchSchema.shape,
      async (params) => {
        try {
                  const searchParams = buildPropertySearchParams(params);
            
    
            
            const result = await rentcastAPI.searchProperties(searchParams);
    
          if (!result.success) {
            return createErrorResponse("Error searching properties", result.error);
          }
    
          const properties = result.data as any[];
          
    
          
          const summary = `Found ${properties.length} properties`;
          
          // Process each property individually based on actual API structure
          const propertyDetails = properties.slice(0, 10).map(prop => {
            return formatPropertyInfo(prop);
          }).join('\n\n');
    
          const resultText = `${summary}\n\n${propertyDetails}${properties.length > 10 ? '\n\n... and more properties available' : ''}`;
          return createSuccessResponse(resultText);
    
              } catch (error) {
            return createErrorResponse("Failed to search properties", error instanceof Error ? error.message : 'Unknown error');
          }
      }
    );
  • Helper function to construct search parameters from MCP tool input params for use with Rentcast API.
    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;
    }
  • Rentcast API service method implementing the HTTP request to '/properties' endpoint for property search.
    async searchProperties(
      params: {
        city?: string;
        state?: string;
        zipCode?: string;
        bedrooms?: number;
        bathrooms?: number;
        propertyType?: string;
        priceRange?: string;
        limit?: number;
      } = {},
    ): Promise<ApiCallResult> {
      const result = await this.makeRequest<RentcastProperty[]>("/properties", {
        ...params,
        limit: params.limit || 15, // Default to 15 for free tier optimization
      });
      return result;
    }
Behavior3/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 adds useful context about default and max limits (15/50 for free tier) and notes that price data may not be unavailable, which helps set expectations. However, it lacks details on pagination, error handling, authentication needs, or rate limits, leaving gaps for a search tool.

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 appropriately sized with two sentences: the first states the purpose and included fields, the second adds important behavioral notes. It's front-loaded with core functionality and avoids redundancy. Minor improvement could be made by integrating the limit info more seamlessly, but overall it's efficient.

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

Completeness3/5

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

Given 7 parameters with full schema coverage and no output schema, the description provides adequate context for a search tool but has gaps. It covers return fields and data limitations (price availability), but lacks details on result format, error cases, or how results are ordered. Without annotations, it should ideally include more behavioral transparency for completeness.

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 already documents all 7 parameters thoroughly. The description lists example fields returned (city, state, bedrooms, etc.), which adds marginal value by clarifying the output scope, but doesn't provide additional parameter semantics beyond what's in the schema. Baseline 3 is appropriate when schema does the heavy lifting.

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 searches for properties with basic property information, specifying the verb 'search' and resource 'properties'. It distinguishes itself from siblings like 'get_property_details' or 'get_sale_listings' by focusing on search functionality with basic info, though it doesn't explicitly contrast with all siblings.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like 'get_sale_listings' or 'get_rental_listings'. It mentions a default and max limit for free tier users, but this is a behavioral constraint rather than usage context. No explicit when/when-not statements or alternative tool references are included.

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