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
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes |
Implementation Reference
- prestashop_mcp/server.py:245-274 (handler)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)
- prestashop_mcp/search_v2.py:99-140 (helper)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()