Skip to content
Skillv1.0.0

notion-debug-bundle

Collect Notion API diagnostic info for troubleshooting and support tickets. Use when encountering persistent API issues, token/auth failures, page access problems, or preparing diagnostic bundles for

by jeremylongshore(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from jeremylongshore/tons-of-skills-marketplace (skills/.curated/notion-debug-bundle/SKILL.md). Install upstream with npx skills add jeremylongshore/tons-of-skills-marketplace --skill notion-debug-bundle. Copyright stays with the author (MIT).

Notion Debug Bundle

Overview

Collect diagnostic information for Notion API issues: SDK version, token validity, database access, page sharing status, rate limits, and platform health. The Notion API requires integrations to be explicitly invited to each page or database — most "not found" errors are sharing problems, not code bugs.

Prerequisites

  • @notionhq/client installed (npm ls @notionhq/client to verify)
  • NOTION_TOKEN environment variable set (internal integration token, starts with ntn_)
  • curl and jq available for shell-based diagnostics

Instructions

Step 1: Quick Connectivity and Auth Check

#!/bin/bash
echo "=== Notion Debug Check ==="
echo "Generated: $(date -u +%Y-%m-%dT%H:%M:%SZ)"

# 1. SDK version
echo -e "\n--- SDK Version ---"
npm ls @notionhq/client 2>/dev/null || echo "SDK not found — run: npm install @notionhq/client"

# 2. Runtime and token status
echo -e "\n--- Runtime ---"
node --version 2>/dev/null || echo "Node.js not found"
echo "NOTION_TOKEN: ${NOTION_TOKEN:+SET (${#NOTION_TOKEN} chars)}"
TOKEN_PREFIX="${NOTION_TOKEN:0:4}"
if [ -n "$NOTION_TOKEN" ] && [ "$TOKEN_PREFIX" != "ntn_" ]; then
  echo "WARNING: Token does not start with 'ntn_' — may be using legacy format"
fi

# 3. API connectivity — /v1/users/me as health check
# Notion-Version 2022-06-28 is the current stable REST API version.
echo -e "\n--- API Connectivity ---"
RESPONSE=$(curl -s -w "\n%{http_code}\n%{time_total}" \
  https://api.notion.com/v1/users/me \
  -H "Authorization: Bearer ${NOTION_TOKEN}" \
  -H "Notion-Version: 2022-06-28" 2>&1)

HTTP_CODE=$(echo "$RESPONSE" | tail -1)
LATENCY=$(echo "$RESPONSE" | tail -2 | head -1)
BODY=$(echo "$RESPONSE" | head -n -2)

echo "HTTP Status: $HTTP_CODE"
echo "Latency: ${LATENCY}s"

if [ "$HTTP_CODE" = "200" ]; then
  echo "Bot Name: $(echo "$BODY" | jq -r '.name // "unknown"')"
  echo "Bot Type: $(echo "$BODY" | jq -r '.type // "unknown"')"
else
  echo "Error Code: $(echo "$BODY" | jq -r '.code // "unknown"')"
  echo "Message: $(echo "$BODY" | jq -r '.message // "unknown"')"
fi

# 4. Notion platform status
echo -e "\n--- Notion Platform Status ---"
curl -s https://status.notion.so/api/v2/status.json \
  | jq -r '.status.description // "Could not reach status page"' 2>/dev/null \
  || echo "Could not reach status.notion.so"

# 5. Rate limit baseline (3 req/sec across all endpoints)
echo -e "\n--- Rate Limit Info ---"
echo "Notion enforces 3 requests/second per integration (across all endpoints)"
echo "Average request rate limits are not exposed in response headers"

Step 2: Full Debug Bundle Script

When the quick check is not enough, run the full collector. It writes an environment snapshot, the redacted auth/database/platform JSON, redacted application logs, the npm dependency tree, and a redacted .env copy into a timestamped directory, then tars it up as notion-debug-YYYYMMDD-HHMMSS.tar.gz. It is safe to attach to a support ticket — tokens, secrets, and avatars are stripped before packaging.

See the complete collector script (notion-debug-bundle.sh) in full implementation.

Step 3: Programmatic Diagnostics

For structured diagnostics inside a Node/TypeScript app, use the SDK directly to test auth (/v1/users/me), database retrieval, and workspace-level search. It returns a plain object for logging or serialization and maps APIErrorCode.ObjectNotFound to the actionable "integration not invited" hint.

See the full collectNotionDiagnostics() function in the programmatic diagnostics reference.

Output

  • notion-debug-YYYYMMDD-HHMMSS.tar.gz containing:
    • environment.txt — SDK version, Node version, token prefix, OS
    • api-auth.json — Bot user info from /v1/users/me (avatar redacted)
    • database-access.json — Database retrieve result (if NOTION_DATABASE_ID set)
    • platform-status.json — status.notion.so health and active incidents
    • logs-*-redacted.txt — Recent Notion-related log entries (tokens masked)
    • dependency-tree.txt — Full npm dependency tree for @notionhq/client
    • env-redacted.txt — Environment config (all values masked)

Error Handling

Error HTTP Cause Fix
unauthorized 401 Invalid or missing token Verify NOTION_TOKEN starts with ntn_, regenerate in integration settings
object_not_found 404 Page/DB not shared with integration Open page in Notion, click Share, invite the integration
rate_limited 429 Exceeded 3 req/sec Add exponential backoff; batch requests where possible
validation_error 400 Malformed page/database ID Use 32-char UUID format (with or without dashes)
conflict_error 409 Concurrent edit conflict Retry with fresh data; avoid parallel writes to same block
internal_server_error 500 Notion platform issue Check status.notion.so; retry after 60s

Examples

Quick reference for the recurring gotchas — validate a token prefix:

# Valid tokens start with ntn_; the old secret_* format is deprecated.
echo "Token prefix: ${NOTION_TOKEN:0:4}"

For page ID normalization (dashed vs dashless UUIDs) and the full redaction rules (what to ALWAYS REDACT vs what is SAFE TO INCLUDE in a bundle), see examples and redaction rules.

Resources

Next Steps

For rate limit issues, see notion-rate-limits. For page sharing and permission problems, see notion-enterprise-rbac.

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/jeremylongshore-tons-of-skills-marketplace-notion-debug-bundle/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

jeremylongshore-tons-of-skills-marketplace-notion-debug-bundle.ocm.jsonjson
{
  "ocm": "1",
  "id": "jeremylongshore-tons-of-skills-marketplace-notion-debug-bundle",
  "kind": "skill",
  "name": "notion-debug-bundle",
  "description": "Collect Notion API diagnostic info for troubleshooting and support tickets. Use when encountering persistent API issues, token/auth failures, page access problems, or preparing diagnostic bundles for Notion support. Trigger with phrases like \"notion debug\", \"notion diagnostic\", \"notion support bundle\", \"collect notion logs\", \"notion troubleshoot\".",
  "publisher": "jeremylongshore",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "coding"
    ],
    "tags": [
      "skill-md",
      "saas",
      "productivity",
      "notion",
      "skills-sh"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Collect Notion API diagnostic info for troubleshooting and support tickets. Use when encountering persistent API issues, token/auth failures, page access problems, or preparing diagnostic bundles for Notion support. Trigger with phrases like \"notion debug\", \"notion diagnostic\", \"notion support bundle\", \"collect notion logs\", \"notion troubleshoot\"."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "skills.sh",
      "repository": "https://github.com/jeremylongshore/tons-of-skills-marketplace",
      "path": "skills/.curated/notion-debug-bundle/SKILL.md",
      "ref": "HEAD",
      "url": "https://github.com/jeremylongshore/tons-of-skills-marketplace/blob/HEAD/skills/.curated/notion-debug-bundle/SKILL.md",
      "key": "jeremylongshore/tons-of-skills-marketplace/skills/.curated/notion-debug-bundle/SKILL.md"
    },
    "compatibility": "Designed for Claude Code",
    "allowed_tools": [
      "Read,",
      "Bash(grep:*),",
      "Bash(curl:*),",
      "Bash(tar:*),",
      "Bash(npm:*),",
      "Bash(node:*)"
    ],
    "license": "MIT"
  },
  "instructions": "# Notion Debug Bundle\n\n## Overview\n\nCollect diagnostic information for Notion API issues: SDK version, token validity, database access, page sharing status, rate limits, and platform health. The Notion API requires integrations to be explicitly invited to each page or database — most \"not found\" errors are sharing problems, not code bugs.\n\n## Prerequisites\n\n- `@notionhq/client` installed (`npm ls @notionhq/client` to verify)\n- `NOTION_TOKEN` environment variable set (internal integration token, starts with `ntn_`)\n- `curl` and `jq` available for shell-based diagnostics\n\n## Instructions\n\n### St",
  "cost": {
    "context_tokens": 1515
  }
}

Fetch it by URL: GET /api/v1/registry/jeremylongshore-tons-of-skills-marketplace-notion-debug-bundle/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.