Skip to main content
Glama

instagram_logout

Log out of Instagram to invalidate the current session and clear saved authentication data, requiring re-login for future access.

Instructions

Logout from Instagram and clear the saved session. This will invalidate the current session and require re-authentication for future operations.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The execute method that handles the instagram_logout tool logic: checks login status, retrieves username if possible, logs out via igpapiClient, and returns appropriate response.
    async execute(args: Record<string, unknown>): Promise<ToolResult> { // Check if already logged out if (!igpapiClient.isLoggedIn()) { return { content: [ { type: "text", text: "Already logged out. No active session to clear.", }, ], }; } // Get current user info before logout (for confirmation message) let username: string | undefined; try { const currentUser = await igpapiClient.getCurrentUser(); username = currentUser.username; } catch { // User info might not be available, continue with logout anyway } // Perform logout await igpapiClient.logout(); return { content: [ { type: "text", text: `Successfully logged out from Instagram${username ? ` (${username})` : ""}.\n\nSession has been cleared. You will need to login again to use Instagram features.`, }, ], }; }
  • Defines the tool's metadata: name 'instagram_logout', description, and input schema with no required parameters.
    getDefinition(): ToolDefinition { return { name: "instagram_logout", description: "Logout from Instagram and clear the saved session. This will invalidate the current session and require re-authentication for future operations.", inputSchema: { type: "object", properties: {}, required: [], }, }; }
  • Instantiates the LogoutTool and adds it to the central tools registry array used for MCP tool registration.
    new LogoutTool(),

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/anand-kamble/mcp-instagram'

If you have feedback or need assistance with the MCP directory API, please join our Discord server