← Mintlify MCPCONTENT HISTORYWHAT CHANGED · RULE-BASED ANALYSIS
Update to Mintlify MCP
Snapshot Sep 30, 2026 · 22:48 UTC · version 1.0.0
Collection source: not recorded for this historical snapshot.
First saved snapshot
No earlier snapshot is available to establish a change.
Compare saved observations
Download comparison JSONFull technical diff · 0 changed fields
Full snapshot data
{
"name": "using-code-mode",
"description": "Use when managing a Mintlify deployment beyond docs content — workflows, deployment settings, members, analytics — or whenever a task needs execute_code / search_code_operations on the Admin MCP.",
"included_files": [],
"skill_md_contents": "---\nname: using-code-mode\ndescription: Use when managing a Mintlify deployment beyond docs content — workflows, deployment settings, members, analytics — or whenever a task needs execute_code / search_code_operations on the Admin MCP.\n---\n\n# Using Code Mode\n\n## Overview\n\n`execute_code` runs a TypeScript/JavaScript script against the Admin MCP dashboard SDK in a sandboxed Cloudflare isolate. It needs **no checkout**, and writes apply **immediately to the live deployment** — there is no branch/PR safety net. Confirm with the user before destructive or customer-visible writes.\n\nAvailable namespaces as top-level globals: `workflows`, `deployment`, `members`, `billing`, `integrations`, `analytics`, `deployments`, plus `console`. No outbound fetch, no secrets; each SDK call is gated by the OAuth scopes on the token. `deployment`, `analytics`, `workflows`, and `members` carry nearly all operations; `billing` and `integrations` are sparse or empty — enumerate with `search_code_operations { namespace: 'billing' }` before assuming a method exists. `members` operations are org-scoped, not per-deployment.\n\n## Find the method first\n\n`search_code_operations { query, namespace?, limit? }` is BM25 search over all SDK methods. Each hit includes the method's full JSON Schema `inputSchema`, so no extra lookup is needed. Pass `namespace` alone to enumerate everything in it (workflows, deployment, members, billing, integrations, analytics). Always search before writing a script — never guess method names or parameter shapes.\n\n## Return semantics (the #1 footgun)\n\nThe script is wrapped in an async function; the value of the **last expression statement** becomes the result.\n\n```\nconst summary = await analytics.getUsageSummary({ usageType: 'CHAT_MESSAGE' });\nconst insights = await analytics.getInsights({});\n({ summary, insights });\n```\n\n- `await x.y();` alone on the last line works.\n- A bare top-level `return X;` is **dropped**.\n- `export default async function ...` returns the function object, not its result.\n\n## Targeting deployments\n\nEvery namespace method takes an optional second argument `{ subdomain }`:\n\n```\nworkflows.listWorkflows({}, { subdomain: 'acme' });\n```\n\nOmit it to use the token's default deployment. `deployments.list()` enumerates the org (requires `deployment:read`). Mixing subdomains in one run is fine.\n\n## Result envelope\n\n`{ ok: true, result, logs, truncated, durationMs }` or `{ ok: false, error: { code, message }, ... }`. Error codes: `unauthorized`, `invalid_json`, `invalid_request`, `misconfigured`, `timeout` (30s wall clock), `sandbox_error` (your script threw), `execution_failed` (worker plumbing). `truncated: true` = result/logs hit the size cap — narrow the query or page through.\n\n## Common mistakes\n\n- Using `return` at top level — result silently becomes undefined.\n- Treating code-mode writes like session edits — they are live instantly; there is no `save`/`discard`.\n- Guessing method signatures instead of calling `search_code_operations`.\n- Calling `checkout` first — unnecessary for code mode.\n- Trying `fetch` or Node APIs — the sandbox has neither.\n"
}SHA-256: efe9f396072be147b1d9954b4efcaac777fbd9ea81bbbd3efea8c0ff8d649159