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(),
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key behaviors: it invalidates the current session and clears saved data, requiring re-authentication. This covers the mutation aspect and consequences, though it could add more on error handling or side effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core action and follows with consequences, using two concise sentences with no wasted words. Every sentence adds value, making it efficient and well-structured for quick understanding.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (a mutation with no parameters) and lack of annotations or output schema, the description is mostly complete. It explains what the tool does and its effects, but could improve by mentioning potential errors or confirming successful logout. It adequately covers the essentials for this simple operation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description appropriately does not discuss parameters, focusing on the tool's action. A baseline of 4 is applied as it handles the zero-parameter case well without unnecessary details.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Logout from Instagram') and the resource affected ('clear the saved session'), distinguishing it from sibling tools like instagram_login or other Instagram operations. It precisely defines what the tool does without being tautological.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context by stating 'This will invalidate the current session and require re-authentication for future operations,' which suggests when to use it (e.g., to end a session or reset authentication). However, it does not explicitly mention when not to use it or name alternatives, such as instagram_login for re-establishing a session.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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