Skip to main content
Glama

validate_auth

Check API credentials to verify authentication status for secure access to Frappe Framework sites.

Instructions

Validate API credentials and return authentication status.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function for the 'validate_auth' tool. It is decorated with @mcp.tool() and simply returns the result of validate_api_credentials().
    @mcp.tool()
    def validate_auth() -> Dict[str, Any]:
        """Validate API credentials and return authentication status."""
        return validate_api_credentials()
  • src/server.py:38-42 (registration)
    The registration point where helpers.register_tools(mcp) is called, which defines and registers the validate_auth tool along with other helpers.
    # Register all tool modules
    helpers.register_tools(mcp)
    documents.register_tools(mcp)
    schema.register_tools(mcp)
    reports.register_tools(mcp)
  • Core helper function validate_api_credentials() that checks environment variables for FRAPPE_API_KEY and FRAPPE_API_SECRET and returns authentication status. This is called directly by the validate_auth handler.
    def validate_api_credentials() -> Dict[str, Any]:
        """
        Validate that required API credentials are available.
        
        Returns:
            Dict containing validation status and details
        """
        api_key = os.getenv("FRAPPE_API_KEY")
        api_secret = os.getenv("FRAPPE_API_SECRET")
        
        if not api_key and not api_secret:
            return {
                "valid": False,
                "message": "Both API key and API secret are missing",
                "details": {
                    "api_key_available": False,
                    "api_secret_available": False,
                    "auth_method": "API key/secret (token)"
                }
            }
        elif not api_key:
            return {
                "valid": False,
                "message": "API key is missing", 
                "details": {
                    "api_key_available": False,
                    "api_secret_available": True,
                    "auth_method": "API key/secret (token)"
                }
            }
        elif not api_secret:
            return {
                "valid": False,
                "message": "API secret is missing",
                "details": {
                    "api_key_available": True,
                    "api_secret_available": False, 
                    "auth_method": "API key/secret (token)"
                }
            }
        
        return {
            "valid": True,
            "message": "API credentials are properly configured",
            "details": {
                "api_key_available": True,
                "api_secret_available": True,
                "auth_method": "API key/secret (token)"
            }
        }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool validates credentials and returns status, but doesn't specify what 'authentication status' includes (e.g., success/failure, error details, token validity), whether it has side effects (e.g., logs attempts), or any rate limits. This is a significant gap for a tool with zero annotation coverage.

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: 'Validate API credentials and return authentication status.' It's front-loaded with the core action and outcome, with no wasted words, making it highly concise and well-structured.

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's low complexity (0 parameters) and the presence of an output schema (which should detail the return values), the description is minimally adequate. However, without annotations and with no guidance on usage or behavioral details, it leaves gaps in understanding the tool's full context and integration with siblings.

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, and the input schema has 100% description coverage (though empty). The description doesn't need to add parameter semantics, so it meets the baseline. It implicitly confirms no parameters are required by not mentioning any, which is appropriate.

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 tool's purpose: 'Validate API credentials and return authentication status.' It specifies the verb ('validate') and resource ('API credentials'), and the outcome ('return authentication status'). However, it doesn't differentiate from sibling tools like 'ping' or 'get_frappe_usage_info', which might also involve system checks, so it's not a perfect 5.

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. It doesn't mention prerequisites (e.g., before making other API calls), exclusions, or compare it to siblings like 'ping' for basic connectivity checks. This lack of context leaves the agent to infer 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/appliedrelevance/frappe-mcp-server'

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