* Feature-detected, so browsers without navigator.modelContext do nothing. */ (function () { if (!("modelContext" in navigator) || typeof navigator.modelContext.registerTool !== "function") { return; }const CONTACT = { email: "[email protected]", phone: "+62 813-8836-8433", address: "Jl. Taman Patra Raya No.10, RT.05/RW.04, Kuningan Timur, Kec. Setiabudi, Jakarta Selatan, DKI Jakarta 12950" };const tools = [ { name: "search_site", description: "Search Masyarakat Ekonomi Syariah (MES) articles and pages by keyword. Opens the site search results.", inputSchema: { type: "object", properties: { query: { type: "string", description: "Keyword to search for, e.g. 'wakaf' or 'keuangan syariah'." } }, required: ["query"] }, execute: async ({ query }) => { const url = "https://www.ekonomisyariah.org/?s=" + encodeURIComponent(String(query || "").trim()); window.location.assign(url); return { content: [{ type: "text", text: "Opened search results: " + url }] }; } }, { name: "get_contact_info", description: "Return the email, phone and postal address of Masyarakat Ekonomi Syariah (MES).", inputSchema: { type: "object", properties: {} }, execute: async () => ({ content: [{ type: "text", text: JSON.stringify(CONTACT) }] }) } ];for (const tool of tools) { try { navigator.modelContext.registerTool(tool); } catch (err) { console.warn("WebMCP registerTool failed for " + tool.name, err); } } })();