Skip to main content
Glama

search_prestashop_docs

Search comprehensive PrestaShop documentation including guides, tutorials, API docs, and hooks to find development resources and solutions.

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

Implementation Reference

  • MCP tool handler for 'search_prestashop_docs'. Receives parameters, calls the search_documentation helper from search_v2, formats and returns search results.
    @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)
  • Core helper function implementing the full-text search logic using SQLite FTS5 on the prestashop_docs table. Returns list of matching documents with snippets.
    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()

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