Skip to main content
Glama

Get Database Stats

get_stats

Retrieve overall API statistics and service health to monitor the SearchCAIE MCP Server's status.

Instructions

Get overall API statistics and service health.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The get_stats tool handler. Registered via @mcp.tool decorator on line 985, it calls the /stats and /health API endpoints and returns overall API statistics and service health including total questions, papers indexed, total marks, years, and health status.
    @mcp.tool(title="Get Database Stats", tags={"search", "core"})
    def get_stats() -> dict[str, Any]:
        """Get overall API statistics and service health."""
        try:
            stats = _api_get("/stats")
        except Exception as exc:
            logger.error("get_stats failed: %s", exc, exc_info=True)
            return _error_from_exception(exc, "/stats")
    
        health_payload: Optional[dict[str, Any]] = None
        try:
            health_data = _api_get("/health")
            if isinstance(health_data, dict):
                health_payload = health_data
        except Exception:
            health_payload = None
    
        years = stats.get("years", []) if isinstance(stats, dict) else []
        if not isinstance(years, list):
            years = []
    
        return {
            "ok": True,
            "api_base": API_BASE,
            "totals": {
                "total_questions": stats.get("total_questions", 0) if isinstance(stats, dict) else 0,
                "papers_indexed": stats.get("papers_indexed", 0) if isinstance(stats, dict) else 0,
                "total_marks": stats.get("total_marks", 0) if isinstance(stats, dict) else 0,
            },
            "years": years,
            "health": health_payload,
        }
  • mcp_server.py:985-985 (registration)
    Registration of get_stats as an MCP tool via the @mcp.tool decorator with title 'Get Database Stats' and 'search'/'core' tags.
    @mcp.tool(title="Get Database Stats", tags={"search", "core"})
Behavior2/5

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

With no annotations provided, the description must fully convey behavioral traits. It only states the purpose without disclosing safety, idempotency, or side effects, which is insufficient for a tool with no annotation support.

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?

Single sentence, no redundancy, perfectly concise for a simple tool.

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 no parameters and presence of an output schema, the description is mostly complete for a basic stats/health endpoint. However, it could elaborate on what 'API statistics' entails to improve agent understanding.

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 zero parameters with 100% coverage, so the baseline is 4. The description does not add parameter info since none exist, but it also does not detract.

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 action ('Get') and the resource ('overall API statistics and service health'), distinguishing it from sibling tools which focus on questions, reports, and searches.

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 on when to use this tool versus alternatives. The description is minimal with no explicit context or exclusion criteria, leaving the agent to infer usage solely from the tool name and sibling names.

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/Pixel2075/searchcaie-mcp'

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