{"record":{"id":"101b0f7fd568c0e0","repo":"googleapis/mcp-toolbox","slug":"include-checkbox-not-found-for-id-includecheckb","errorCode":null,"errorMessage":"Include checkbox not found for ID: ${includeCheckboxId}","messagePattern":"Include checkbox not found for ID: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"internal/server/static/js/toolDisplay.js","lineNumber":484,"sourceCode":"}\n\n/**\n * Checks if a specific parameter is marked as included for a given tool.\n * @param {string} toolId The ID of the tool.\n * @param {string} paramName The name of the parameter.\n * @return {boolean|null} True if the parameter's include checkbox is checked,\n *                         False if unchecked, Null if the checkbox element is not found.\n */\nexport function isParamIncluded(toolId, paramName) {\n    const inputId = `param-${toolId}-${paramName}`;\n    const includeCheckboxId = `include-${inputId}`;\n    const includeCheckbox = document.getElementById(includeCheckboxId);\n\n    if (includeCheckbox && includeCheckbox.type === 'checkbox') {\n        return includeCheckbox.checked;\n    }\n\n    console.warn(`Include checkbox not found for ID: ${includeCheckboxId}`);\n    return null;\n}\n\n// Templates for inserting token retrieval instructions into edit header modal\nconst AUTH_TOKEN_INSTRUCTIONS_SERVICE_ACCOUNT = `\n        <p>To obtain a Google OAuth ID token using a service account:</p>\n        <ol>\n            <li>Make sure you are on the intended SERVICE account (typically contain iam.gserviceaccount.com). Verify by running the command below.\n                <pre><code>gcloud auth list</code></pre>\n            </li>\n            <li>Print an id token with the audience set to your clientID defined in config:\n                <pre><code>gcloud auth print-identity-token --audiences=YOUR_CLIENT_ID_HERE</code></pre>\n            </li>\n            <li>Copy the output token.</li>\n            <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>\n                <pre><code>{\n  \"Content-Type\": \"application/json\",\n  \"my-google-auth_token\": \"YOUR_ID_TOKEN_HERE\"","sourceCodeStart":466,"sourceCodeEnd":502,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/server/static/js/toolDisplay.js#L466-L502","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Hard-refresh the UI (Ctrl/Cmd+Shift+R) so JS and server markup versions match","Inspect the DOM for the expected checkbox ID and compare with the ID construction in toolDisplay.js","Rebuild the toolbox so embedded JS and HTML templates come from the same version","If you modified UI templates, update the ID generation in isParamIncluded to match"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"const cb = document.getElementById(includeCheckboxId);\nif (!(cb instanceof HTMLInputElement) || cb.type !== 'checkbox') {\n  console.warn('include checkbox missing:', includeCheckboxId);\n}","typeGuard":"function isCheckbox(el) {\n  return el instanceof HTMLInputElement && el.type === 'checkbox';\n}","tryCatchPattern":"function safeIsParamIncluded(id) {\n  const el = document.getElementById(id);\n  if (!isCheckbox(el)) return false; // explicit fallback instead of null\n  return el.checked;\n}","preventionTips":["Hard-refresh to keep cached toolDisplay.js in sync with server-rendered markup","Rebuild the binary so embedded JS and HTML templates share one version","Keep checkbox ID construction in one helper used by both template and lookup code","Only call isParamIncluded after the parameter rows are rendered in the DOM"],"tags":["javascript","dom","ui","checkbox","null"],"backgroundTag":"missing-dom-element","analyzedSha":"8cc6e09de2ad7b8bffc77751799585a1401a48eb","analyzedAt":"2026-09-05T01:10:36.887Z","contentChangedAt":"2026-09-05T01:10:36.887Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}