Skip to main content
Glama

test_connection

Verify connectivity to the Wakapi server by testing the API endpoint and retrieving project data to confirm proper setup and access.

Instructions

Test Wakapi server connection via simple API call to fetch projects.

Returns: A dictionary with the connection test result, including: - status (str): 'success' or 'error'. - message (str): Description of the result. - projects_count (int, optional): Number of projects if successful. - server_url (str): The Wakapi server URL. - api_path (str): The API path used for requests. - error (str, optional): Error message if failed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The test_connection tool handler: an async function that tests the Wakapi server connection by fetching projects. It returns success or error status with details. Registered via @app.tool decorator.
    @app.tool
    async def test_connection() -> dict[str, Any]:
        """Test Wakapi server connection via simple API call to fetch projects.
    
        Returns:
            A dictionary with the connection test result, including:
            - status (str): 'success' or 'error'.
            - message (str): Description of the result.
            - projects_count (int, optional): Number of projects if successful.
            - server_url (str): The Wakapi server URL.
            - api_path (str): The API path used for requests.
            - error (str, optional): Error message if failed.
        """
        logger = get_logger("connection_tool")
        from mcp_tools.dependency_injection import get_wakapi_client
    
        logger.info("Starting connection test", method="test_connection")
    
        client = get_wakapi_client()
    
        try:
            # Test connection with a simple API call
            projects = await client.get_projects()
            logger.debug(
                f"Projects type: {type(projects)}, data length: "
                f"{len(projects.data) if hasattr(projects, 'data') else 'No data attr'}"
            )
    
            return {
                "status": "success",
                "message": f"Successfully connected to Wakapi server "
                f"({client.config.base_url})",
                "projects_count": len(projects.data),
                "server_url": client.config.base_url,
                "api_path": client.config.api_path,
            }
        except Exception as e:
            return {
                "status": "error",
                "message": f"Failed to connect to Wakapi server: {e!s}",
                "server_url": client.config.base_url,
                "api_path": client.config.api_path,
                "error": str(e),
            }
  • main.py:151-153 (registration)
    Explicit import of the test_connection function within initialize_tools() to trigger its automatic registration via the @app.tool decorator.
    from mcp_tools.connection import test_connection
    
    _ = test_connection  # Trigger registration
Behavior3/5

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

With no annotations provided, the description carries full burden and does disclose this is a read-only diagnostic operation that makes an API call. However, it doesn't mention potential side effects, authentication requirements, rate limits, or error handling specifics beyond what's in the return structure.

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 efficiently structured with the purpose in the first sentence and return details in a clear bulleted format. Every sentence adds value without redundancy, making it easy to parse quickly.

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 diagnostic nature, 0 parameters, and the presence of an output schema (implied by the detailed return description), the description is mostly complete. However, it could benefit from mentioning typical use cases or prerequisites like server configuration.

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?

With 0 parameters and 100% schema description coverage, the baseline would be 4. The description appropriately notes there are no input parameters by not discussing any, which aligns perfectly with the empty input schema.

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 ('Test Wakapi server connection') and method ('via simple API call to fetch projects'), distinguishing it from sibling tools that retrieve actual data rather than testing connectivity. It explicitly identifies the resource being accessed (Wakapi server) and the verification mechanism.

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 specifying this is for connection testing, suggesting it should be used to verify server accessibility before invoking other tools. However, it doesn't explicitly state when NOT to use it or name specific alternative tools for different purposes.

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/impure0xntk/mcp-wakapi'

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