Skip to main content
Glama
tandat8503

Rentcast MCP Server

by tandat8503

get_sale_listings

Search for properties currently for sale using location parameters like city, state, or ZIP code to retrieve comprehensive listing information with detailed property data.

Instructions

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

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

  • Primary MCP tool handler for 'get_sale_listings': validates params, builds search parameters, calls Rentcast API service, formats listings with property info and parameter suggestions, handles errors, and returns formatted text response.
    async (params) => {
      try {
        const searchParams = buildPropertySearchParams(params);
    
        const result = await rentcastAPI.getSaleListings(searchParams);
    
        if (!result.success) {
          return createErrorResponse("Error getting sale listings", result.error);
        }
    
        const listings = result.data as any[];
        
    
        
        const summary = `Found ${listings.length} sale 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 sale listings", error instanceof Error ? error.message : 'Unknown error');
        }
    }
  • Zod input schema defining parameters for listing searches (city, state, zipCode, limit), used by get_sale_listings tool.
    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)",
        ),
    });
  • src/index.ts:651-654 (registration)
    MCP tool registration call for 'get_sale_listings' with name, description, input schema, and handler reference.
    server.tool(
      "get_sale_listings",
      "Get sale listings with comprehensive property information. This tool searches for properties currently for sale.",
      ListingSearchSchema.shape,
  • Rentcast API service method that executes the HTTP request to '/listings/sale' endpoint with parameters and returns ApiCallResult.
    async getSaleListings(
      params: {
        city?: string;
        state?: string;
        zipCode?: string;
        limit?: number;
      } = {},
    ): Promise<ApiCallResult> {
      const result = await this.makeRequest<RentcastListing[]>("/listings/sale", {
        ...params,
        limit: params.limit || 15, // Default to 15 for free tier optimization
      });
      return result;
    }
  • Utility function to construct search parameters from input params, used in get_sale_listings handler.
    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 full burden but only mentions it 'searches' without disclosing behavioral traits like whether it requires authentication, has rate limits, returns paginated results, or what happens with partial matches. The 'comprehensive property information' phrase is vague about what's included.

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?

Two concise sentences that efficiently convey the core purpose. The first sentence establishes the tool's function, and the second clarifies the search scope. No wasted words, though it could be slightly more structured with usage guidance.

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?

For a search tool with 4 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what 'comprehensive property information' includes, how results are formatted, whether all parameters are optional, or how the search behaves with multiple location parameters.

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 4 parameters thoroughly. The description adds no additional parameter semantics beyond what's in the schema, maintaining the baseline score of 3 for adequate but not enhanced 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 verb 'get' and resource 'sale listings' with the purpose 'searches for properties currently for sale'. It distinguishes from rental listings but doesn't explicitly differentiate from other search-related siblings like search_properties or get_random_properties.

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?

No guidance on when to use this tool versus alternatives like search_properties, get_random_properties, or get_rental_listings. The description only states what it does without providing context about when it's the appropriate choice among the seven sibling tools.

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