Skip to main content
Glama

search_prestashop_docs

Search comprehensive PrestaShop documentation including guides, tutorials, API docs, hooks, and development resources to find specific information for building and maintaining PrestaShop stores.

Instructions

Search ALL PrestaShop documentation (guides, tutorials, API docs, hooks, etc.).

Args: query: Search query (e.g., "install", "Mac", "deployment") doc_type: Filter by type: hook, guide, tutorial, api, reference, component, faq, general category: Filter by category: basics, development, modules, themes, etc.

Returns: Search results with snippets and metadata

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
doc_typeNo
categoryNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Handler function decorated with @mcp.tool() for registration. Defines input schema via type hints and docstring. Implements tool logic by calling search_documentation helper and formatting output.
    @mcp.tool()
    def search_prestashop_docs(
        query: str,
        doc_type: Optional[str] = None,
        category: Optional[str] = None
    ) -> str:
        """Search ALL PrestaShop documentation (guides, tutorials, API docs, hooks, etc.).
    
        Args:
            query: Search query (e.g., "install", "Mac", "deployment")
            doc_type: Filter by type: hook, guide, tutorial, api, reference, component, faq, general
            category: Filter by category: basics, development, modules, themes, etc.
    
        Returns:
            Search results with snippets and metadata
        """
        logger.info(f"Searching documentation for: {query} (type={doc_type}, category={category})")
        results = search_documentation(query, doc_type=doc_type, category=category, limit=10)
    
        if not results:
            filters = []
            if doc_type:
                filters.append(f"type={doc_type}")
            if category:
                filters.append(f"category={category}")
            filter_str = f" (filters: {', '.join(filters)})" if filters else ""
            return f"No results found for: {query}{filter_str}"
    
        # Format results
        output = [f"Found {len(results)} documents for: {query}\n"]
    
        for i, doc in enumerate(results, 1):
            output.append(f"{i}. **{doc['title']}** ({doc['doc_type']})")
            output.append(f"   Category: {doc['category']}")
            if doc.get('subcategory'):
                output.append(f"   Subcategory: {doc['subcategory']}")
            output.append(f"   Path: {doc['path']}")
    
            if doc.get('snippet'):
                output.append(f"   {doc['snippet']}")
    
            output.append("")
    
        output.append("\nUse get_prestashop_doc('path') to get the full document content.")
    
        return "\n".join(output)
  • Supporting utility function that performs the actual full-text search on the SQLite database using FTS5, returning structured document results used by the tool handler.
    def search_documentation(
        query: str,
        doc_type: Optional[str] = None,
        category: Optional[str] = None,
        limit: int = 10
    ) -> List[Dict]:
        """Search all PrestaShop documentation using FTS5.
    
        Args:
            query: Search query
            doc_type: Filter by document type (hook, guide, tutorial, api, etc.)
            category: Filter by category (basics, development, modules, etc.)
            limit: Maximum number of results
    
        Returns:
            List of matching documents with metadata
        """
        conn = sqlite3.connect(DB_PATH)
        cursor = conn.cursor()
    
        # Build FTS5 query
        fts_query = query.replace("'", "''")  # Escape quotes
    
        # Build WHERE clause for filters
        filters = []
        params = [fts_query]
    
        if doc_type:
            filters.append("d.doc_type = ?")
            params.append(doc_type)
    
        if category:
            filters.append("d.category = ?")
            params.append(category)
    
        where_clause = ""
        if filters:
            where_clause = f" AND {' AND '.join(filters)}"
    
        # Search query
        query_sql = f"""
            SELECT
                d.name,
                d.title,
                d.category,
                d.subcategory,
                d.doc_type,
                d.path,
                d.origin,
                d.location,
                d.content,
                d.metadata,
                d.version,
                snippet(prestashop_docs_fts, -1, '<mark>', '</mark>', '...', 32) as snippet
            FROM prestashop_docs d
            JOIN prestashop_docs_fts fts ON d.id = fts.rowid
            WHERE prestashop_docs_fts MATCH ?{where_clause}
            ORDER BY rank
            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],
                    "origin": row[6],
                    "location": row[7],
                    "content": row[8],
                    "metadata": json.loads(row[9]) if row[9] else {},
                    "version": row[10],
                    "snippet": row[11]
                })
    
            return results
    
        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 full burden. It mentions the search scope and returns 'results with snippets and metadata,' but fails to disclose critical behavioral traits like pagination, rate limits, authentication needs, error handling, or whether it's read-only/destructive. For a search tool with zero annotation coverage, this leaves significant gaps.

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 appropriately sized and front-loaded with the core purpose in the first sentence. The Args and Returns sections are structured for clarity, though the 'Returns' line could be more concise (e.g., merging with the first sentence). Every sentence adds value, with minimal redundancy.

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 3 parameters with 0% schema coverage and an output schema present, the description does well on parameters but lacks behavioral context (no annotations). The output schema means return values needn't be explained, but for a search tool, details like result format limits or error cases would enhance completeness. It's adequate but has clear gaps in transparency.

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?

Schema description coverage is 0%, so the description must compensate. It adds substantial meaning beyond the schema by explaining each parameter's purpose (e.g., 'query' for search, 'doc_type' and 'category' as filters with examples), including enum-like values for doc_type and category. This effectively documents all 3 parameters, though it could specify if filters are optional (implied by null defaults).

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 specific action ('Search ALL PrestaShop documentation') and resource ('guides, tutorials, API docs, hooks, etc.'), distinguishing it from siblings like get_prestashop_doc (retrieves single doc) or search_prestashop_hooks (specific to hooks). The verb 'search' is precise and the scope 'ALL' is explicitly defined.

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 provides clear context by specifying the scope ('ALL PrestaShop documentation') and listing document types, which helps differentiate it from siblings like list_prestashop_docs (likely lists without search) or search_prestashop_hooks (hooks-specific). However, it lacks explicit when-not-to-use guidance or direct alternative naming.

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