Skip to main content
Glama

get_prestashop_doc

Retrieve complete PrestaShop documentation content by specifying the file path, enabling direct access to development guides, hooks, APIs, and theme resources.

Instructions

Get the full content of a specific PrestaShop documentation file.

Args: path: Document path (e.g., 'basics/installation/environments/macos-specific.md')

Returns: Full document content with metadata

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes

Implementation Reference

  • The primary handler and registration for the MCP tool 'get_prestashop_doc'. This function is decorated with @mcp.tool(), retrieves the document data using the helper get_document, and formats it for output.
    @mcp.tool()
    def get_prestashop_doc(path: str) -> str:
        """Get the full content of a specific PrestaShop documentation file.
    
        Args:
            path: Document path (e.g., 'basics/installation/environments/macos-specific.md')
    
        Returns:
            Full document content with metadata
        """
        logger.info(f"Getting document: {path}")
        doc = get_document(path)
    
        if not doc:
            return f"Document '{path}' not found. Use search_prestashop_docs() to find documents."
    
        # Format document
        output = [f"# {doc['title']}\n"]
        output.append(f"**Type:** {doc['doc_type']}")
        output.append(f"**Category:** {doc['category']}")
        if doc.get('subcategory'):
            output.append(f"**Subcategory:** {doc['subcategory']}")
        if doc.get('version'):
            output.append(f"**Version:** {doc['version']}")
        output.append(f"**Path:** {doc['path']}\n")
    
        output.append("---\n")
        output.append(doc['content'])
    
        return "\n".join(output)
  • Core helper function that implements the document retrieval logic by querying the SQLite database (prestashop_docs table) using the provided path and returns the full document metadata and content.
    def get_document(path: str) -> Optional[Dict]:
        """Get a specific document by path.
    
        Args:
            path: Document path (e.g., 'basics/installation/system-requirements.md')
    
        Returns:
            Document data or None if not found
        """
        conn = sqlite3.connect(DB_PATH)
        cursor = conn.cursor()
    
        try:
            cursor.execute("""
                SELECT
                    name, title, category, subcategory, doc_type, path,
                    origin, location, content, metadata, version
                FROM prestashop_docs
                WHERE path = ?
            """, (path,))
    
            row = cursor.fetchone()
            if not row:
                return None
    
            return {
                "name": row[0],
                "title": row[1],
                "category": row[2],
                "subcategory": row[3],
                "doc_type": row[4],
                "path": row[5],
                "origin": row[6],
                "location": row[7],
                "content": row[8],
                "metadata": json.loads(row[9]) if row[9] else {},
                "version": row[10]
            }
    
        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