vapi_logout
Log out of Vapi and clear stored credentials to handle stale auth tokens or switch accounts.
Instructions
Log out of Vapi and clear stored credentials. Use this if your auth token is stale or you want to switch accounts.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:98-115 (handler)The vapi_logout tool handler: clears stored credentials via clearConfig() and resets the vapiClient to null, then returns a success message.
// Register logout tool mcpServer.tool( 'vapi_logout', 'Log out of Vapi and clear stored credentials. Use this if your auth token is stale or you want to switch accounts.', {}, async () => { clearConfig(); vapiClient = null; return { content: [ { type: 'text' as const, text: 'Logged out of Vapi. Use vapi_login to sign in again.', }, ], }; } ); - src/index.ts:98-115 (registration)The tool is registered via mcpServer.tool() with the name 'vapi_logout', description, empty schema, and an async handler callback.
// Register logout tool mcpServer.tool( 'vapi_logout', 'Log out of Vapi and clear stored credentials. Use this if your auth token is stale or you want to switch accounts.', {}, async () => { clearConfig(); vapiClient = null; return { content: [ { type: 'text' as const, text: 'Logged out of Vapi. Use vapi_login to sign in again.', }, ], }; } ); - src/index.ts:102-102 (schema)The vapi_logout tool uses an empty schema {} since it accepts no input parameters.
{}, - src/auth.ts:63-72 (helper)The clearConfig() helper function deletes the config file at ~/.vapi/config.json and resets the in-memory cachedConfig to null.
export function clearConfig(): void { try { if (fs.existsSync(CONFIG_FILE)) { fs.unlinkSync(CONFIG_FILE); } } catch (error) { // Ignore errors } cachedConfig = null; }