Skip to main content
Glama
GetPropertyExtraInfoTool.ts1.6 kB
import { z } from "zod"; import { MCPTool } from "mcp-framework"; interface GetPropertyExtraInfoInput { cod_ofer?: number; ref?: string; } class GetPropertyExtraInfoTool extends MCPTool<GetPropertyExtraInfoInput> { name = "get_property_extra_info"; description = "Get extra information (portal publication info, leads) for a property"; schema = { cod_ofer: { type: z.number().optional(), description: "Unique identifier of the property (Priority: High)", }, ref: { type: z.string().optional(), description: "Public reference of the property (Priority: Medium)", }, }; async execute({ cod_ofer, ref }: GetPropertyExtraInfoInput) { if (!cod_ofer && !ref) { throw new Error("Either 'cod_ofer' or 'ref' must be provided"); } let url = "https://procesos.inmovilla.com/api/v1/propiedades/?extrainfo&"; const params = new URLSearchParams(); if (cod_ofer) params.append("cod_ofer", cod_ofer.toString()); if (ref) params.append("ref", ref); url += params.toString(); const token = process.env.INMOVILLA_API_TOKEN; if (!token) { throw new Error("INMOVILLA_API_TOKEN environment variable is not set"); } const response = await this.fetch<any>(url, { method: "GET", headers: { "Content-Type": "application/json", "Token": token, }, }); return response; } } export default GetPropertyExtraInfoTool;

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/laica-ayudavets/mcp-inmovilla'

If you have feedback or need assistance with the MCP directory API, please join our Discord server