Skip to main content
Glama
vargahis

monarch-mcp

debug_session_loading

Diagnose and resolve authentication session loading problems in Monarch Money's secure keychain system.

Instructions

Debug keyring session loading issues.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The debug_session_loading tool handler function that checks keyring for session tokens. It uses @mcp.tool() decorator for registration and calls secure_session.load_token() to retrieve the token from the system keyring.
    @mcp.tool()
    def debug_session_loading() -> str:
        """Debug keyring session loading issues."""
        try:
            # Check keyring access
            token = secure_session.load_token()
            if token:
                return f"Token found in keyring (length: {len(token)})"
            return "No token found in keyring. Run login_setup.py to authenticate."
        except Exception as e:  # pylint: disable=broad-exception-caught
            error_details = traceback.format_exc()
            return (
                f"Keyring access failed:\nError: {e}\n"
                f"Type: {type(e)}\nTraceback:\n{error_details}"
            )
  • The load_token() method in SecureMonarchSession class that loads the authentication token from the system keyring. This is the core helper function used by debug_session_loading to check if a token exists.
    def load_token(self) -> Optional[str]:
        """Load the authentication token from the system keyring."""
        try:
            token = keyring.get_password(KEYRING_SERVICE, KEYRING_USERNAME)
            if token:
                logger.info("Token loaded from keyring")
                return token
            logger.info("No token found in keyring")
            return None
        except Exception as e:  # pylint: disable=broad-exception-caught
            logger.error("Failed to load token from keyring: %s", e)
            return None
  • The global secure_session singleton instance of SecureMonarchSession that is imported and used by the debug_session_loading handler.
    # Global session manager instance
    secure_session = SecureMonarchSession()
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions 'debug' but doesn't disclose behavioral traits such as whether it's read-only or mutative, what output to expect, or if it has side effects like resetting sessions. For a debugging tool with zero annotation coverage, this is insufficient.

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 a single, efficient sentence with no wasted words. It's front-loaded and appropriately sized for a simple tool, making it easy to parse quickly.

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

Completeness3/5

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

Given the tool has 0 parameters, 100% schema coverage, and an output schema exists, the description is minimally adequate. However, as a debugging tool with no annotations, it should ideally explain what 'debug' involves (e.g., logs, diagnostics) to be more complete, but the output schema may cover return values.

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 tool has 0 parameters with 100% schema description coverage, so no parameter documentation is needed. The description doesn't add parameter details, which is appropriate. Baseline is 4 for zero parameters, as it avoids unnecessary complexity.

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

Purpose3/5

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

The description states the tool's purpose as debugging keyring session loading issues, which is clear but vague. It specifies the action (debug) and target (keyring session loading issues), but doesn't explain what 'debug' entails or how it differs from sibling tools like 'check_auth_status' or 'setup_authentication' that also relate to authentication/session management.

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?

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites, context (e.g., after authentication failures), or exclusions. Given sibling tools like 'check_auth_status' and 'setup_authentication', the lack of differentiation leaves usage ambiguous.

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/vargahis/monarch-mcp'

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