get_prestashop_doc
Retrieve complete PrestaShop documentation content by specifying a file path, enabling developers to access specific technical guides and resources directly.
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 handler function for the MCP tool 'get_prestashop_doc'. It is registered via @mcp.tool() decorator, includes schema in docstring, retrieves the document using the get_document helper, and formats the output with metadata.@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-139 (helper)Supporting helper function that queries the SQLite database (prestashop_docs table) to fetch the full document data by path, used by the get_prestashop_doc tool handler.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()