AI agents can make affordable housing discovery far more useful when they can search structured, current and location-specific project data instead of relying on general web results. A WebMCP (Web Model Context Protocol) layer can give agents controlled access to PMAY-related housing information, project listings, eligibility rules, locations, prices and application links.
For Indian founders, the goal is not merely to connect an AI model to a website. A production-grade system must distinguish between PMAY-Urban and PMAY-Gramin, handle changing government schemes and project statuses, cite authoritative sources, protect applicant data and clearly separate verified facts from estimates. This guide explains how to create a WebMCP for agents to search for affordable housing projects under PMAY.
What is a WebMCP?
A WebMCP is a tool and data interface that allows an AI agent to interact with web-accessible capabilities in a predictable way. Instead of asking a language model to browse randomly, you expose defined tools such as:
search_housing_projectsget_project_detailscheck_pmay_schemefind_nearby_projectsget_application_linkcompare_projects
Each tool should have a strict input schema, a documented output format, validation rules and source attribution. The agent can then decide which tool to call, receive structured results and explain them to the user.
For this use case, the WebMCP becomes a policy-aware search layer between an AI agent and housing data sources. It should not make eligibility decisions on behalf of government authorities unless the result is explicitly presented as a preliminary assessment.
Define the housing search problem first
Before writing code, define exactly what the agent must answer. “Find affordable housing under PMAY” can involve several different questions:
- Which PMAY scheme applies to the user?
- Is the user searching in an urban or rural area?
- Which state, district, city, ward or PIN code is relevant?
- Are they looking for a completed, under-construction or announced project?
- What is the approximate price, carpet area or unit type?
- Is the project listed by an authorised public body?
- Where can the user verify eligibility and apply?
A useful agent workflow might be:
1. Collect the user’s location and housing preference.
2. Identify whether PMAY-Urban or PMAY-Gramin is potentially relevant.
3. Search approved or verified project data.
4. Filter by location, status, unit type and affordability.
5. Return a short list with source links and last-updated timestamps.
6. Explain that final eligibility and allotment depend on the relevant authority.
This scope prevents the model from presenting unrelated private projects as PMAY-supported housing.
Understand PMAY data and scheme boundaries
PMAY is not a single universal property catalogue. Its structure, implementation and available data depend on the specific programme and government authority. PMAY-Urban has historically included components such as beneficiary-led construction, affordable housing in partnership and other urban housing interventions. PMAY-Gramin focuses on rural housing assistance and is not equivalent to a searchable urban apartment-project marketplace.
Your WebMCP should therefore model scheme fields explicitly rather than using a generic pmay: true flag. Recommended fields include:
scheme_namescheme_version_or_phasecomponentstatedistricturban_local_bodyvillage_or_blockproject_nameimplementing_agencydeveloper_or_contractorapproval_statusconstruction_statusunit_typecarpet_area_sq_mprice_range_inrsubsidy_or_assistance_descriptionbeneficiary_categorysource_urllast_verified_at
Use official PMAY portals, state housing boards, urban local bodies and other authoritative public sources wherever possible. A property portal or scraped listing may be useful for discovery, but it should not be treated as proof of PMAY approval.
Choose a practical WebMCP architecture
A robust architecture can contain five layers:
1. Source connectors
Connectors retrieve data from official APIs, downloadable files, web pages, public dashboards or approved partner databases. Prefer APIs and structured downloads. If a source has no API, use a compliant ingestion process that respects its terms, robots rules and rate limits.
2. Normalisation pipeline
Government datasets often use inconsistent spellings for cities, districts and agencies. Normalise:
- State and district names
- PIN codes and geographic coordinates
- Currency values
- Dates and status labels
- Carpet-area units
- Scheme and component names
Maintain the original value alongside the normalised value so users can inspect the source representation.
3. Search index
Use PostgreSQL with PostGIS for structured filtering and geographic queries. OpenSearch or Elasticsearch can provide full-text search, while a vector database can support semantic matching for natural-language requests. Do not rely on embeddings alone for hard constraints such as price, location or project status.
A hybrid query should combine:
- Exact filters for scheme, state, district and status
- Geographic distance calculations
- Full-text matching for project and locality names
- Semantic retrieval for phrases such as “low-cost homes near Pune”
4. WebMCP tool server
The tool server exposes narrowly scoped functions to the AI agent. It should handle authentication, input validation, query execution, ranking, citations and error responses.
5. Agent application
The user-facing application can be a chat interface, WhatsApp workflow, web search assistant or voice application. The agent should call tools, ask clarifying questions and render source-backed results rather than inventing listings.
Design the core WebMCP tools
Keep tools small and composable. A single tool that accepts unrestricted natural language and returns arbitrary web content is difficult to secure and evaluate.
Search projects tool
Example input schema:
{
"state": "Maharashtra",
"district": "Pune",
"city": "Pimpri-Chinchwad",
"pin_code": "411018",
"max_price_inr": 2500000,
"unit_type": "1BHK",
"status": "under_construction",
"scheme": "PMAY-Urban",
"radius_km": 15,
"page": 1,
"page_size": 10
}Validate fields before executing the search. Restrict page_size, reject impossible price values and canonicalise location names. If the user provides only a conversational request, the agent should extract parameters and ask for missing information when it materially changes the result.
Example output:
{
"results": [
{
"project_id": "pmay-example-001",
"project_name": "Example Housing Project",
"location": {
"city": "Pimpri-Chinchwad",
"district": "Pune",
"state": "Maharashtra"
},
"scheme": "PMAY-Urban",
"status": "under_construction",
"unit_type": "1BHK",
"price_range_inr": {
"min": 1800000,
"max": 2200000
},
"source_url": "https://authoritative-source.example/project",
"last_verified_at": "2026-08-15"
}
],
"total": 1,
"warnings": [
"Price and availability must be confirmed with the implementing authority."
]
}Project details tool
This tool should return the complete record, including approval documents where publicly available, authority contacts, construction milestones, unit details and application instructions. Always include source_url and last_verified_at.
Eligibility guidance tool
Treat this as an information tool, not an approval engine. It can present scheme-level conditions, document checklists and links to official guidance. It should avoid stating “you are eligible” unless the result is clearly labelled as a non-binding preliminary indication.
Application-link tool
Return only verified application or authority URLs. Be careful with phishing risks: users searching for housing are particularly vulnerable to fake registration fees and impersonation. Display the domain clearly and warn users not to transfer money to unverified accounts.
Build source authority and freshness controls
The most important quality problem is stale or misleading data. Add a source registry with fields such as:
- Source owner
- Official-domain status
- Data type
- Retrieval method
- Update frequency
- Last successful fetch
- Expected schema
- Contact or escalation route
Use freshness rules by field. A project’s location may remain stable, but price, availability, application dates and construction status can change quickly. If a record exceeds its freshness threshold, return it with a visible “needs verification” label or exclude it from transactional recommendations.
Store provenance for every important field. For example, do not merely save price = 2000000; save the source document, page, extraction timestamp and confidence. This makes agent responses auditable and helps correct errors.
Ranking affordable housing results
Ranking should be transparent. A practical score can combine:
- Geographic relevance
- Match to requested unit type
- Affordability relative to the user’s budget
- Project-status relevance
- Source authority
- Data freshness
- Completeness of required fields
Do not rank a project highly just because its description contains the word “PMAY.” Require a validated scheme association and source evidence. If the user asks for the cheapest option, sort by verified total price but explain whether the amount excludes registration, maintenance, parking, taxes or other charges.
Add India-specific location intelligence
Indian housing search requires more than a city-name filter. Users may provide a PIN code, local landmark, village, taluka, municipal corporation or a spelling in Hindi, Marathi, Tamil or another Indian language.
Useful capabilities include:
- PIN-code to district and locality mapping
- Geocoding with confidence scores
- Alias tables for renamed cities and districts
- Transliteration and multilingual search
- Rural and urban administrative-boundary handling
- Distance calculations that account for incomplete coordinates
Never infer a precise address from a vague landmark without telling the user that the location is approximate. For rural searches, capture state, district, block and gram panchayat separately instead of forcing the data into an urban-city model.
Protect personal data and prevent fraud
A housing assistant may handle names, phone numbers, income information, caste or category details, identity documents and bank-related data. Apply data minimisation from the beginning.
Recommended controls include:
- Do not collect Aadhaar or identity documents for basic project search.
- Encrypt sensitive data in transit and at rest.
- Separate search history from application records.
- Use role-based access and audit logs.
- Set retention and deletion policies.
- Obtain clear consent before sharing details with a developer or authority.
- Redact personal data from model prompts and logs.
- Rate-limit public tools and monitor abuse.
In India, align the product with applicable obligations under the Digital Personal Data Protection Act, 2023 and relevant sectoral requirements. Obtain legal review before processing sensitive information or acting as an application intermediary.
Prevent hallucinations and unsafe agent behaviour
Use tool-grounded generation. The model should be instructed to:
- Answer from tool results for project-specific claims.
- Cite the source URL beside each recommendation.
- Say when no verified result is available.
- Avoid inventing prices, deadlines, approval status or eligibility.
- Distinguish PMAY assistance from the sale price of a unit.
- Ask clarifying questions instead of guessing location or budget.
- Never claim to submit an application unless the system actually completed that action.
Add refusal and escalation paths for requests involving forged documents, bypassing eligibility rules, unofficial payments or evading verification.
Evaluate the WebMCP before launch
Create a test set based on real Indian housing queries, including multilingual and ambiguous examples:
- “PMAY flat near Nagpur under 20 lakh”
- “house assistance in rural Gaya”
- “1 BHK affordable project near Bengaluru metro”
- “PMAY project in Thane with online application”
- “क्या पुणे में प्रधानमंत्री आवास योजना के घर उपलब्ध हैं?”
Measure:
- Retrieval precision and recall
- Location accuracy
- Scheme classification accuracy
- Citation coverage
- Freshness accuracy
- Tool-call success rate
- Hallucination rate
- Unresolved-query rate
- Latency and cost per conversation
Have housing-policy and local-government domain experts review a sample of answers. Automated tests cannot reliably detect every misleading interpretation of scheme rules.
Suggested implementation stack
A cost-conscious MVP could use:
- Backend: Python FastAPI or Node.js
- Database: PostgreSQL with PostGIS
- Search: OpenSearch, Elasticsearch or PostgreSQL full-text search
- Queue: Redis with Celery, BullMQ or a managed queue
- Object storage: S3-compatible storage for source snapshots
- WebMCP server: Schema-validated tool endpoints with authentication
- Observability: Structured logs, traces and tool-call metrics
- Deployment: Indian cloud region where appropriate, with backups and disaster recovery
Start with one state or a small set of verified sources. A narrow, accurate directory is more valuable than a national index full of stale listings. Expand coverage only after establishing a repeatable ingestion and verification process.
Launch checklist
Before releasing the agent, verify that:
- PMAY-Urban and PMAY-Gramin are not conflated.
- Every project result has a source and verification date.
- Search filters are validated and enforced server-side.
- Prices clearly state what is included and excluded.
- Application links point to official or authorised domains.
- Users see a warning that availability and eligibility require confirmation.
- Personal data is not collected unnecessarily.
- Stale records are automatically flagged.
- The agent can say “I don’t know.”
- Human support is available for disputes and corrections.
FAQ: WebMCP for PMAY housing search
Can a WebMCP directly approve a PMAY application?
No. It can provide search, guidance and links to official processes. Eligibility, allotment and approval remain with the competent government authority.
Should I scrape every property website?
No. Prioritise official sources and comply with website terms, robots rules, copyright and privacy obligations. Use third-party listings only as clearly labelled supplementary information.
Is PMAY the same as an affordable housing project?
No. A project may be marketed as affordable without being formally associated with PMAY. Your system must verify the scheme, component and implementing authority.
What should the agent do when no project is found?
It should explain the search filters, suggest nearby locations or broader criteria and provide official scheme guidance. It must not fabricate a result.
Can the assistant support Hindi and other Indian languages?
Yes. Add multilingual intent detection, transliteration, local-name aliases and translated explanations, while preserving official scheme names and source links accurately.
Apply for AI Grants India
Building a trustworthy WebMCP for affordable housing can create measurable public value while solving a difficult technical and policy problem. Indian AI founders developing housing discovery, civic-tech or government-service infrastructure can apply to AI Grants India for support and visibility.