aps_logout
Clears the cached 3-legged OAuth token, reverting API calls to the 2-legged app-context token for authentication.
Instructions
Clear the cached 3‑legged OAuth token. After this, API calls fall back to the 2‑legged (app‑context) token.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:1015-1021 (handler)Handler for 'aps_logout' tool. Calls clear3loLogin() to clear cached 3LO tokens in memory and on disk, then returns a confirmation message.
// ── aps_logout (clear 3LO) ───────────────────────────────── if (name === "aps_logout") { clear3loLogin(); return ok( "3-legged session cleared. API calls will now use the 2-legged (app) token.", ); } - src/index.ts:158-165 (registration)Tool definition/registration for aps_logout in the TOOLS array. Describes the tool and declares an empty input schema (no parameters).
// 0b ── aps_logout (clear 3LO session) { name: "aps_logout", description: "Clear the cached 3‑legged OAuth token. " + "After this, API calls fall back to the 2‑legged (app‑context) token.", inputSchema: { type: "object" as const, properties: {} }, }, - src/aps-auth.ts:452-456 (helper)Core helper function clear3loLogin() that deletes the cached token file on disk and clears the in-memory cache, effectively logging out the 3-legged session.
/** Clear any cached 3LO tokens (in‑memory + on disk). */ export function clear3loLogin(): void { deleteCacheFile(); cached3lo = null; } - src/aps-auth.ts:220-226 (helper)Helper function deleteCacheFile() that removes the 3LO token file (~/.aps-mcp/3lo-tokens.json) from disk.
function deleteCacheFile(): void { try { if (existsSync(TOKEN_FILE)) unlinkSync(TOKEN_FILE); } catch { /* ignore */ } }