<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="https://affordabletherapyontario.com/wp-sitemap-index.xsl" ?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><sitemap><loc>https://affordabletherapyontario.com/wp-sitemap-posts-page-1.xml</loc></sitemap><sitemap><loc>https://affordabletherapyontario.com/wp-sitemap-users-1.xml</loc></sitemap></sitemapindex>
<script src="https://affordabletherapyontario.com/webmcp.js" id="arkit-webmcp-src"></script>
<script id="arkit-webmcp">(function () {
  var siteName = "Affordable Therapy Ontario";
  var contactPath = "\/contact-us\/";
  var contactInfo = {"email":"webmaster@orthoplexsolutions.com","contact_form":"https:\/\/affordabletherapyontario.com\/contact-us\/"};
  var controller = (typeof AbortController !== 'undefined') ? new AbortController() : null;
  var registered = Object.create(null);

  var tools = [
    {
      name: "affordable_therapy_ontario_search_site",
      description: 'Search ' + siteName + ' for pages or posts matching a query. Returns titles and URLs.',
      inputSchema: {
        type: 'object',
        properties: {
          query: { type: 'string', description: 'Search term' }
        },
        required: ['query']
      },
      execute: async function (args) {
        var input = args || {};
        var query = input.query || '';
        var res = await fetch('/wp-json/wp/v2/search?search=' + encodeURIComponent(query) + '&per_page=5');
        if (!res.ok) return { content: [{ type: 'text', text: 'Search failed: ' + res.status }] };
        var data = await res.json();
        return {
          content: [{
            type: 'text',
            text: JSON.stringify(data.map(function (r) {
              return { title: r.title, url: r.url, type: r.subtype || r.type };
            }))
          }]
        };
      }
    },
    {
      name: "affordable_therapy_ontario_get_overview",
      description: 'Fetch structured facts about ' + siteName + '.',
      inputSchema: { type: 'object', properties: {} },
      execute: async function () {
        var res = await fetch('/.well-known/agent-skills/company-overview.md');
        if (!res.ok) return { content: [{ type: 'text', text: 'Fetch failed: ' + res.status }] };
        return { content: [{ type: 'text', text: await res.text() }] };
      }
    },
    {
      name: "affordable_therapy_ontario_get_contact_info",
      description: 'Get contact details for ' + siteName + '.',
      inputSchema: { type: 'object', properties: {} },
      execute: async function () {
        return { content: [{ type: 'text', text: JSON.stringify(contactInfo) }] };
      }
    },
    {
      name: "affordable_therapy_ontario_open_contact_page",
      description: 'Navigate to the contact page for ' + siteName + '.',
      inputSchema: { type: 'object', properties: {} },
      execute: async function () {
        window.location.href = contactPath;
        return { content: [{ type: 'text', text: JSON.stringify({ navigated: true, url: contactPath }) }] };
      }
    }
  ];

  function contexts() {
    var list = [];
    try {
      if (document && document.modelContext) list.push(document.modelContext);
    } catch (e) {}
    try {
      if (navigator && navigator.modelContext) list.push(navigator.modelContext);
    } catch (e) {}
    try {
      if (window.modelContext) list.push(window.modelContext);
    } catch (e) {}
    return list;
  }

  function installOn(ctx) {
    if (!ctx || typeof ctx !== 'object') return false;
    var ok = false;
    var key = '';
    try { key = String(ctx); } catch (e) { key = 'ctx'; }

    if (typeof ctx.provideContext === 'function') {
      try {
        ctx.provideContext({ tools: tools });
        ok = true;
      } catch (e) {}
    }

    if (typeof ctx.registerTool === 'function') {
      for (var i = 0; i < tools.length; i++) {
        var t = tools[i];
        var mark = key + '::' + t.name;
        if (registered[mark]) {
          ok = true;
          continue;
        }
        try {
          var ret = ctx.registerTool(
            {
              name: t.name,
              description: t.description,
              inputSchema: t.inputSchema,
              execute: t.execute
            },
            controller ? { signal: controller.signal } : undefined
          );
          if (ret && typeof ret.then === 'function') {
            ret.then(function () {}).catch(function () {});
          }
          registered[mark] = true;
          ok = true;
        } catch (e) {}
      }
    }
    if (ok) {
      window.__arkitWebmcpInstalled = true;
      window.__arkitWebmcpToolCount = tools.length;
    }
    return ok;
  }

  // Do NOT polyfill/overwrite navigator.modelContext — isitagentready injects its own
  // capture API; shadowing it makes "No tools registered via navigator.modelContext".
  function install() {
    var list = contexts();
    var ok = false;
    for (var i = 0; i < list.length; i++) {
      if (installOn(list[i])) ok = true;
    }

    try {
      if (navigator && navigator.modelContext && typeof navigator.modelContext.provideContext === 'function') {
        navigator.modelContext.provideContext({ tools: tools });
        ok = true;
        window.__arkitWebmcpInstalled = true;
        window.__arkitWebmcpToolCount = tools.length;
      }
    } catch (e) {}

    try {
      if (navigator && navigator.modelContext && typeof navigator.modelContext.registerTool === 'function') {
        for (var j = 0; j < tools.length; j++) {
          try {
            var r = navigator.modelContext.registerTool(
              {
                name: tools[j].name,
                description: tools[j].description,
                inputSchema: tools[j].inputSchema,
                execute: tools[j].execute
              },
              controller ? { signal: controller.signal } : undefined
            );
            if (r && typeof r.then === 'function') r.then(function () {}).catch(function () {});
            ok = true;
            window.__arkitWebmcpInstalled = true;
            window.__arkitWebmcpToolCount = tools.length;
          } catch (e2) {}
        }
      }
    } catch (e) {}

    return ok;
  }

  if (window.__arkitWebmcpBooted) {
    install();
    return;
  }
  window.__arkitWebmcpBooted = true;

  install();
  var n = 0;
  var t = setInterval(function () {
    n += 1;
    install();
    if (window.__arkitWebmcpInstalled || n >= 200) clearInterval(t);
  }, 25);

  document.addEventListener('DOMContentLoaded', install);
  window.addEventListener('load', install);
  try {
    if (document.documentElement) {
      var mo = new MutationObserver(function () { install(); });
      mo.observe(document.documentElement, { childList: true, subtree: true, attributes: true });
      setTimeout(function () { try { mo.disconnect(); } catch (e) {} }, 15000);
    }
  } catch (e) {}
})();</script>
