Skip to main content
Glama

Check Server Status

server_status
Read-only

Check PricePilot server health and data freshness to verify category seeding is current (within 10 days). Returns degraded status with reason if overdue.

Instructions

Report PricePilot server health, data freshness, and degraded-state reason.

Use to check whether category seeding is current (staleness threshold is 10 days) before trusting downstream tool output. Returns degraded status with reason if data is overdue; healthy otherwise.

Returns: server (name), version, status (healthy / degraded), categories_available, data_freshness (ISO timestamp of last seed), degraded_reason (null if healthy).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The server_status() function — the actual tool handler that checks DB for latest category seed, computes freshness/age, and returns health status or degraded reason.
    def server_status() -> dict:
        """Report PricePilot server health, data freshness, and degraded-state reason.
    
        Use to check whether category seeding is current (staleness threshold is
        10 days) before trusting downstream tool output. Returns degraded status
        with reason if data is overdue; healthy otherwise.
    
        Returns:
            server (name),
            version,
            status (healthy / degraded),
            categories_available,
            data_freshness (ISO timestamp of last seed),
            degraded_reason (null if healthy).
        """
        rate_err = _check_rate_limit()
        if rate_err:
            return {"error": rate_err}
    
        db = SessionLocal()
        try:
            from sqlalchemy import func
    
            latest = db.query(func.max(CategoryBenchmark.captured_at)).scalar()
            categories_with_data = (
                db.query(CategoryBenchmark.category_id).distinct().count()
            )
    
            status = "healthy"
            degraded_reason = None
    
            if latest is None:
                status = "degraded"
                degraded_reason = "No category data seeded yet"
            else:
                age_days = (datetime.now(timezone.utc) - latest).days
                if age_days > STALE_THRESHOLD_DAYS:
                    status = "degraded"
                    degraded_reason = f"Category seeding overdue ({age_days} days since last seed)"
    
            return {
                "server": "pricepilot",
                "version": SERVER_VERSION,
                "status": status,
                "categories_available": categories_with_data,
                "data_freshness": f"Last seeded: {latest.isoformat() if latest else 'never'}",
                "degraded_reason": degraded_reason,
            }
        finally:
            db.close()
  • Tool registration in SERVER_CARD dict — declares the 'server_status' tool name and description for MCP discovery.
            {
                "name": "server_status",
                "description": "Server health + data-freshness check (degraded if category seed is stale).",
            },
        ],
        "resources": [],
        "prompts": [],
    }
  • @mcp.tool decorator registering server_status as an MCP tool with title 'Check Server Status' and READ_ONLY annotation.
    @mcp.tool(title="Check Server Status", annotations=READ_ONLY)
  • CategoryBenchmark model — the DB table queried by server_status() to get the latest captured_at timestamp and category count.
    from .db import Base
    
    
    def _utcnow() -> datetime:
        return datetime.now(timezone.utc)
    
    
    def _new_id() -> str:
        return uuid.uuid4().hex
    
    
    class CategoryBenchmark(Base):
Behavior5/5

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

Beyond annotations (readOnlyHint, destructiveHint), the description adds the staleness threshold (10 days), degraded reason behavior, and specific return fields. This fully discloses operational behavior.

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?

Description is concise, front-loads purpose and usage, then lists return fields. Every sentence adds value; no redundancy.

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

Completeness5/5

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

Given no parameters and no output schema, the description fully explains all return fields with types and conditions. It is complete for this low-complexity tool.

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?

Input schema has no parameters (0 params, 100% schema coverage). Baseline of 4 is appropriate since description has no need to explain parameters.

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 it checks server health, data freshness, and degraded-state reason. It distinguishes from siblings like compare_products and get_category_overview by focusing on server status rather than product or category data.

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 explicitly advises using this tool to verify category seeding currency before trusting downstream tools, providing clear context. It lacks explicit when-not-to-use but the guidance is sufficient.

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/vantage-meridian-group/pricepilot-mcp'

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