Skip to main content
Glama

logout

End your session on the eClass platform to secure your account and complete your interaction with the MCP server.

Instructions

Log out from eClass

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
random_stringYesDummy parameter for no-parameter tools

Implementation Reference

  • The main handler function for the 'logout' tool, which calls authentication helpers to perform logout and format the response.
    async def handle_logout() -> List[types.TextContent]:
        """Handle logout from eClass."""
        success, username_or_error = authentication.perform_logout(session_state)
        return [authentication.format_logout_response(success, username_or_error)]
  • Registration of the 'logout' tool in the list_tools handler, including name, description, and input schema.
    types.Tool(
        name="logout",
        description="Log out from eClass",
        inputSchema={
            "type": "object",
            "properties": {
                "random_string": {
                    "type": "string",
                    "description": "Dummy parameter for no-parameter tools"
                },
            },
            "required": ["random_string"],
        },
    ),
  • Input schema definition for the 'logout' tool (uses dummy parameter since no real inputs are needed).
    inputSchema={
        "type": "object",
        "properties": {
            "random_string": {
                "type": "string",
                "description": "Dummy parameter for no-parameter tools"
            },
        },
        "required": ["random_string"],
  • Helper function that performs the actual logout by making a GET request to the logout URL and resetting session state.
    def perform_logout(session_state: SessionState) -> Tuple[bool, Optional[str]]:
        """
        Log out from eClass.
        
        Returns:
            Tuple of (success, username_or_error).
            On success with prior login: (True, username)
            On success without prior login: (True, None)
            On failure: (False, error_message)
        """
        if not session_state.logged_in:
            return True, None
        
        try:
            response = session_state.session.get(session_state.logout_url)
            response.raise_for_status()
            
            username = session_state.username
            session_state.reset()
            return True, username
        except Exception as e:
            logger.error(f"Logout error: {e}")
            return False, f"Error during logout: {e}"
  • Helper function to format the logout response as MCP TextContent.
    def format_logout_response(
        success: bool, username_or_error: Optional[str]
    ) -> types.TextContent:
        """Format logout response for MCP."""
        if success:
            if username_or_error:
                return types.TextContent(
                    type="text",
                    text=f"Successfully logged out user {username_or_error}.",
                )
            return types.TextContent(
                type="text",
                text="Not logged in, nothing to do.",
            )
        return types.TextContent(
            type="text",
            text=f"Error during logout: {username_or_error}",
        )
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While 'Log out' implies session termination, it doesn't specify what gets invalidated, whether this affects other tools, if re-authentication is required afterward, or what happens on failure. The description lacks important behavioral context for a security-sensitive operation.

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 maximally concise with just three words that directly convey the tool's purpose. There's zero waste or unnecessary elaboration, and it's perfectly front-loaded with the essential information.

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

Completeness2/5

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

For a security operation like logout with no annotations and no output schema, the description is insufficient. It doesn't explain what happens after logout, whether the operation can fail, what state changes occur, or how this affects subsequent tool calls. The minimal description leaves critical behavioral questions unanswered.

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 100% description coverage, with the single parameter clearly documented as a 'Dummy parameter for no-parameter tools.' The description doesn't need to add parameter semantics since the tool conceptually requires no real parameters, and the schema adequately explains the dummy parameter requirement.

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

Purpose4/5

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

The description clearly states the action ('Log out') and target system ('from eClass'), providing a specific verb+resource combination. However, it doesn't differentiate from sibling tools like 'login' or 'authstatus' beyond the obvious action difference.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like 'authstatus' to check login state, or whether logout should follow certain workflows. It simply states what the tool does without context about appropriate usage scenarios.

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/sdi2200262/eclass-mcp-server'

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