Skip to main content
Glama
UpdatePropertyTool.ts2.6 kB
import { z } from "zod"; import { MCPTool } from "mcp-framework"; interface UpdatePropertyInput { ref: string; keyacci?: number; key_tipo?: number; key_loca?: string; nodisponible?: boolean; precioinmo?: number; banyos?: number; habitaciones?: number; prospecto?: boolean; fotos?: Record<string, { url: string; posicion?: number }>; [key: string]: any; // Allow other optional fields } class UpdatePropertyTool extends MCPTool<UpdatePropertyInput> { name = "update_property"; description = "Update an existing property or prospect in Inmovilla"; schema = { ref: { type: z.string(), description: "Reference of the property to update (Must be unique)", }, keyacci: { type: z.number().optional(), description: "Operation type ID", }, key_tipo: { type: z.number().optional(), description: "Property type ID", }, key_loca: { type: z.string().optional(), description: "City/Locality code", }, nodisponible: { type: z.boolean().optional(), description: "If the property is not available", }, precioinmo: { type: z.number().optional(), description: "Price for the agency", }, banyos: { type: z.number().optional(), description: "Number of bathrooms", }, habitaciones: { type: z.number().optional(), description: "Number of rooms", }, prospecto: { type: z.boolean().optional(), description: "Set to true to create as a prospect", }, fotos: { type: z.record(z.object({ url: z.string(), posicion: z.number().optional(), })).optional(), description: "Object containing photo URLs", }, }; async execute(input: UpdatePropertyInput) { const url = "https://procesos.inmovilla.com/api/v1/propiedades/"; 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: "POST", headers: { "Content-Type": "application/json", "Token": token, }, body: JSON.stringify(input), }); return response; } } export default UpdatePropertyTool;

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