Skip to main content
Glama

End User Search

end_user_search
Read-only

Search published website content using exact text matching, AI semantic analysis, or combined hybrid mode to find relevant pages and information.

Instructions

Search published content using full-text exact match, semantic (AI) similarity, or hybrid mode. Returns page titles, paths, and snippets.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMax results 1-50 (default 10)
modeNoSearch mode: exact, semantic, or hybrid (default hybrid)
queryYesSearch query,required

Implementation Reference

  • The `runQuery` function handles the "end_user_search" logic by querying the /api/chat endpoint and processing SSE streaming responses.
    function runQuery(query, cfg, bodyId, inputId, sendId) {
      var body = document.getElementById(bodyId);
      var sendBtn = document.getElementById(sendId);
      var input = document.getElementById(inputId);
    
      body.innerHTML = '<div class="lc-loading"><div class="lc-dot"></div><div class="lc-dot"></div><div class="lc-dot"></div></div>';
      sendBtn.disabled = true;
    
      var loadingRemoved = false;
      var answerEl = null;
      var sourcesEl = null;
      var rawAnswer = '';
    
      function removeLoading() {
        if (!loadingRemoved) {
          var l = body.querySelector('.lc-loading');
          if (l) l.remove();
          loadingRemoved = true;
        }
      }
    
      function ensureAnswer() {
        if (!answerEl) {
          removeLoading();
          answerEl = document.createElement('div');
          answerEl.className = 'lc-answer';
          body.appendChild(answerEl);
        }
        return answerEl;
      }
    
      function handleEvent(evt) {
        if (evt.type === 'token' && evt.text) {
          rawAnswer += evt.text;
          ensureAnswer().innerHTML = renderMarkdown(rawAnswer);
          body.scrollTop = body.scrollHeight;
        } else if (evt.type === 'sources') {
          removeLoading();
          var results = evt.results || [];
          if (results.length === 0 && !answerEl) {
            body.innerHTML = '<p class="lc-no-results">No results found. Try rephrasing your question.</p>';
            return;
          }
          if (results.length > 0) {
            sourcesEl = document.createElement('div');
            sourcesEl.className = 'lc-sources';
            var html = '<div class="lc-sources-label">Sources</div>';
            for (var i = 0; i < results.length; i++) {
              var r = results[i];
              html += '<a class="lc-result" href="' + escHtml(r.url) + '">' +
                '<span class="lc-result-arrow">↗</span>' +
                '<span class="lc-result-title">' + escHtml(r.title) + '</span>' +
                '</a>';
            }
            sourcesEl.innerHTML = html;
            body.appendChild(sourcesEl);
            body.scrollTop = body.scrollHeight;
          }
        } else if (evt.type === 'done') {
          sendBtn.disabled = false;
          input.value = '';
          input.focus();
        }
      }
    
      fetch(baseURL + '/api/chat?q=' + encodeURIComponent(query))
        .then(function (res) {
          if (!res.ok || !res.body) throw new Error('HTTP ' + res.status);
          var reader = res.body.getReader();
          var decoder = new TextDecoder();
          var buffer = '';
    
          function pump() {
            return reader.read().then(function (result) {
              if (result.done) { sendBtn.disabled = false; return; }
              buffer += decoder.decode(result.value, { stream: true });
              var parts = buffer.split('\n\n');
              buffer = parts.pop();
              for (var i = 0; i < parts.length; i++) {
                var p = parts[i].trim();
                if (p.indexOf('data: ') === 0) {
                  try { handleEvent(JSON.parse(p.slice(6))); } catch (e) {}
                }
              }
              return pump();
            });
          }
          return pump();
        })
        .catch(function () {
          sendBtn.disabled = false;
          body.innerHTML = '<p class="lc-no-results">Something went wrong. Please try again.</p>';
        });
    }
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true (safe operation). The description adds valuable return structure disclosure ('page titles, paths, and snippets') which compensates for the missing output schema, but omits other behavioral details like rate limits, result ordering, or empty-result handling.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two well-structured sentences with zero redundancy. Front-loaded with the action 'Search published content', followed by mechanism (match modes), then return values. Every word earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 100% schema coverage and readOnly annotations, the description is appropriately complete. It compensates for the missing output schema by specifying the return payload structure ('titles, paths, and snippets'). Could be improved by noting result limits or pagination behavior.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with clear descriptions for all three parameters (query, mode, limit). The description reinforces the mode options ('full-text exact match', 'semantic (AI)') but does not add syntax guidance, format requirements, or examples beyond what the schema already provides. Baseline 3 is appropriate for high-coverage schemas.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clear verb ('Search') and resource ('published content') with specific scope. The phrase 'published content' effectively distinguishes this end-user facing search from administrative alternatives like 'search_content' that might include drafts, though it doesn't explicitly name the sibling alternative.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use this tool versus the sibling 'search_content' tool, or when to prefer exact vs semantic vs hybrid modes. The description provides no 'when-not-to-use' constraints or prerequisite conditions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/jonradoff/lightcms'

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