googleapis/mcp-toolbox · warning

Include checkbox not found for ID: ${includeCheckboxId}

Error message

Include checkbox not found for ID: ${includeCheckboxId}

What it means

toolDisplay.js's isParamIncluded looks up a DOM checkbox by a generated ID (includeCheckboxId) to decide whether a tool parameter is included in an invocation. If the element is missing or is not a checkbox, it warns and returns null, meaning the caller (INCLUDE_CHECKED) cannot determine inclusion. This usually indicates DOM/template drift — the checkbox markup wasn't rendered as expected.

Source

Thrown at internal/server/static/js/toolDisplay.js:484

}

/**
 * Checks if a specific parameter is marked as included for a given tool.
 * @param {string} toolId The ID of the tool.
 * @param {string} paramName The name of the parameter.
 * @return {boolean|null} True if the parameter's include checkbox is checked,
 *                         False if unchecked, Null if the checkbox element is not found.
 */
export function isParamIncluded(toolId, paramName) {
    const inputId = `param-${toolId}-${paramName}`;
    const includeCheckboxId = `include-${inputId}`;
    const includeCheckbox = document.getElementById(includeCheckboxId);

    if (includeCheckbox && includeCheckbox.type === 'checkbox') {
        return includeCheckbox.checked;
    }

    console.warn(`Include checkbox not found for ID: ${includeCheckboxId}`);
    return null;
}

// Templates for inserting token retrieval instructions into edit header modal
const AUTH_TOKEN_INSTRUCTIONS_SERVICE_ACCOUNT = `
        <p>To obtain a Google OAuth ID token using a service account:</p>
        <ol>
            <li>Make sure you are on the intended SERVICE account (typically contain iam.gserviceaccount.com). Verify by running the command below.
                <pre><code>gcloud auth list</code></pre>
            </li>
            <li>Print an id token with the audience set to your clientID defined in config:
                <pre><code>gcloud auth print-identity-token --audiences=YOUR_CLIENT_ID_HERE</code></pre>
            </li>
            <li>Copy the output token.</li>
            <li>Paste this token into the header in JSON editor. The key should be the name of your auth service followed by <code>_token</code>
                <pre><code>{
  "Content-Type": "application/json",
  "my-google-auth_token": "YOUR_ID_TOKEN_HERE"

View on GitHub (pinned to 8cc6e09de2)

Solutions

  1. Hard-refresh the UI (Ctrl/Cmd+Shift+R) so JS and server markup versions match
  2. Inspect the DOM for the expected checkbox ID and compare with the ID construction in toolDisplay.js
  3. Rebuild the toolbox so embedded JS and HTML templates come from the same version
  4. If you modified UI templates, update the ID generation in isParamIncluded to match
Defensive patterns

Strategy: type-guard

Validate before calling

const cb = document.getElementById(includeCheckboxId);
if (!(cb instanceof HTMLInputElement) || cb.type !== 'checkbox') {
  console.warn('include checkbox missing:', includeCheckboxId);
}

Type guard

function isCheckbox(el) {
  return el instanceof HTMLInputElement && el.type === 'checkbox';
}

Try / catch

function safeIsParamIncluded(id) {
  const el = document.getElementById(id);
  if (!isCheckbox(el)) return false; // explicit fallback instead of null
  return el.checked;
}

Prevention

When it happens

Trigger: Calling the parameter-run/edit flow when the expected include-checkbox element with ID includeCheckboxId was never rendered — e.g. dynamic IDs changed, the parameter row template changed, or JS runs before the DOM section renders.

Common situations: Browser cache serving an old toolDisplay.js against new server-rendered markup (or vice versa); custom modifications to the UI templates; a parameter type that doesn't render a checkbox; running actions on a partially loaded page.

Related errors


AI-assisted analysis of googleapis/mcp-toolbox@8cc6e09de2 (2026-09-05). Data as JSON: /api/errors/101b0f7fd568c0e0. Report an issue: GitHub.