Skip to main content
Glama

list_prestashop_docs

Find PrestaShop documentation files by type and category to access development resources, hooks, APIs, and guides.

Instructions

List PrestaShop documentation files.

Args: doc_type: Filter by type: hook, guide, tutorial, api, reference, component, faq, general category: Filter by category: basics, development, modules, themes, etc.

Returns: List of available documents

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
doc_typeNo
categoryNo

Implementation Reference

  • Handler function for the list_prestashop_docs tool. It retrieves documents using list_documents helper, groups them by category, and formats a markdown list with titles, types, paths, limited to 20 per category.
    @mcp.tool()
    def list_prestashop_docs(
        doc_type: Optional[str] = None,
        category: Optional[str] = None
    ) -> str:
        """List PrestaShop documentation files.
    
        Args:
            doc_type: Filter by type: hook, guide, tutorial, api, reference, component, faq, general
            category: Filter by category: basics, development, modules, themes, etc.
    
        Returns:
            List of available documents
        """
        logger.info(f"Listing documents (type={doc_type}, category={category})")
        docs = list_documents(doc_type=doc_type, category=category, limit=50)
    
        if not docs:
            return "No documents found matching the filters"
    
        # Group by category
        by_category = {}
        for doc in docs:
            cat = doc['category']
            if cat not in by_category:
                by_category[cat] = []
            by_category[cat].append(doc)
    
        output = [f"Available PrestaShop Documentation ({len(docs)} documents)\n"]
    
        for category, category_docs in sorted(by_category.items()):
            output.append(f"## {category.title()} ({len(category_docs)} docs)\n")
    
            for doc in category_docs[:20]:  # Limit to 20 per category
                subcat = f" / {doc['subcategory']}" if doc.get('subcategory') else ""
                output.append(f"- **{doc['title']}** ({doc['doc_type']}){subcat}")
                output.append(f"  Path: {doc['path']}")
    
            if len(category_docs) > 20:
                output.append(f"\n  ... and {len(category_docs) - 20} more documents")
            output.append("")
    
        return "\n".join(output)
  • Database helper function that queries the SQLite database for documents matching doc_type and category filters, returning a list of document summaries used by the tool handler.
    def list_documents(
        doc_type: Optional[str] = None,
        category: Optional[str] = None,
        limit: int = 50
    ) -> List[Dict]:
        """List documents with optional filters.
    
        Args:
            doc_type: Filter by document type
            category: Filter by category
            limit: Maximum number of results
    
        Returns:
            List of documents (summary only)
        """
        conn = sqlite3.connect(DB_PATH)
        cursor = conn.cursor()
    
        # Build WHERE clause
        filters = []
        params = []
    
        if doc_type:
            filters.append("doc_type = ?")
            params.append(doc_type)
    
        if category:
            filters.append("category = ?")
            params.append(category)
    
        where_clause = ""
        if filters:
            where_clause = f"WHERE {' AND '.join(filters)}"
    
        query_sql = f"""
            SELECT
                name, title, category, subcategory, doc_type, path
            FROM prestashop_docs
            {where_clause}
            ORDER BY category, subcategory, title
            LIMIT ?
        """
    
        params.append(limit)
    
        try:
            cursor.execute(query_sql, params)
            results = []
    
            for row in cursor.fetchall():
                results.append({
                    "name": row[0],
                    "title": row[1],
                    "category": row[2],
                    "subcategory": row[3],
                    "doc_type": row[4],
                    "path": row[5]
                })
    
            return results
    
        finally:
            conn.close()

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