Skip to main content
Glama

get_prestashop_stats

Retrieve statistics about indexed PrestaShop documentation including document counts, types, categories, and specialized data for development reference.

Instructions

Get statistics about indexed PrestaShop documentation.

Returns: Statistics about documents, types, categories, and specialized data

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The primary MCP tool handler for get_prestashop_stats. Decorated with @mcp.tool() for registration. Fetches stats from helper and formats as Markdown report.
    @mcp.tool()
    def get_prestashop_stats() -> str:
        """Get statistics about indexed PrestaShop documentation.
    
        Returns:
            Statistics about documents, types, categories, and specialized data
        """
        logger.info("Getting documentation statistics")
        stats = get_stats()
    
        output = ["# PrestaShop Documentation Statistics\n"]
    
        output.append(f"**Total Documents:** {stats['total_documents']}\n")
    
        output.append("## By Document Type\n")
        for doc_type, count in sorted(stats['by_type'].items(), key=lambda x: x[1], reverse=True):
            output.append(f"- {doc_type}: {count}")
        output.append("")
    
        output.append("## By Category\n")
        for category, count in sorted(stats['by_category'].items(), key=lambda x: x[1], reverse=True):
            output.append(f"- {category}: {count}")
        output.append("")
    
        output.append("## Specialized Data\n")
        output.append(f"- Domain References (CQRS): {stats['domain_references']}")
        output.append(f"- UI Components: {stats['components']}")
    
        return "\n".join(output)
  • Core helper function that queries the SQLite database (prestashop_docs.db) to compute and return statistics: total docs, grouped by type and category, plus counts for domain_references and components tables.
    def get_stats() -> Dict:
        """Get documentation statistics.
    
        Returns:
            Statistics about indexed documentation
        """
        conn = sqlite3.connect(DB_PATH)
        cursor = conn.cursor()
    
        try:
            # Total documents
            cursor.execute("SELECT COUNT(*) FROM prestashop_docs")
            total_docs = cursor.fetchone()[0]
    
            # By document type
            cursor.execute("""
                SELECT doc_type, COUNT(*) as count
                FROM prestashop_docs
                GROUP BY doc_type
                ORDER BY count DESC
            """)
            by_type = {row[0]: row[1] for row in cursor.fetchall()}
    
            # By category
            cursor.execute("""
                SELECT category, COUNT(*) as count
                FROM prestashop_docs
                GROUP BY category
                ORDER BY count DESC
            """)
            by_category = {row[0]: row[1] for row in cursor.fetchall()}
    
            # Domain references
            cursor.execute("SELECT COUNT(*) FROM domain_references")
            domain_refs = cursor.fetchone()[0]
    
            # Components
            cursor.execute("SELECT COUNT(*) FROM components")
            components = cursor.fetchone()[0]
    
            return {
                "total_documents": total_docs,
                "by_type": by_type,
                "by_category": by_category,
                "domain_references": domain_refs,
                "components": components
            }
    
        finally:
            conn.close()
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 returns statistics about documents, types, categories, and specialized data, but lacks details on permissions, rate limits, or whether it's read-only. For a tool with zero annotation coverage, this leaves significant gaps in understanding its operational traits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and front-loaded, with the main purpose stated clearly in the first sentence. The second sentence elaborates on return values, which is useful given the output schema. There's no wasted text, making it efficient, though it could be slightly more structured for clarity.

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 simplicity (0 parameters, output schema provided), the description is somewhat complete but lacks depth. It explains what statistics are returned, but without annotations, it misses behavioral context like safety or performance. The output schema helps, but the description should ideally cover more operational aspects to be fully adequate.

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 0 parameters with 100% coverage, so no parameter documentation is needed. The description doesn't add parameter details, which is appropriate here. It receives a baseline score of 4 because it doesn't need to compensate for any schema gaps, and the absence of parameters is handled correctly.

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: 'Get statistics about indexed PrestaShop documentation.' It specifies the verb ('Get statistics') and resource ('indexed PrestaShop documentation'), making the function unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'get_prestashop_doc' or 'list_prestashop_docs', which focus on retrieving documents rather than statistics.

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 sibling tools or contexts where statistics are needed over raw data, such as for monitoring or summary purposes. Without this, users must infer usage from the tool name alone.

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/florinel-chis/prestashop-mcp'

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