get_liquid_object
Retrieve complete documentation for Shopify Liquid objects like 'product', 'cart', or 'shop' to understand their properties and usage in theme development.
Instructions
Get documentation for a specific Shopify Liquid object.
Args: object_name: Name of the object (e.g., 'product', 'cart', 'shop')
Returns: Complete object documentation
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| object_name | Yes |
Implementation Reference
- shopify_liquid_mcp/server.py:95-110 (handler)The main handler function for the get_liquid_object tool. It takes an object_name parameter, retrieves the corresponding documentation using get_document('objects', object_name), and returns the content or an error message if not found. The docstring defines the input/output schema.@mcp.tool() def get_liquid_object(object_name: str) -> str: """Get documentation for a specific Shopify Liquid object. Args: object_name: Name of the object (e.g., 'product', 'cart', 'shop') Returns: Complete object documentation """ doc = get_document("objects", object_name) if not doc: return f"Object '{object_name}' not found. Use list_liquid_objects() to see available objects." return doc["content"]
- shopify_liquid_mcp/ingest.py:285-319 (helper)Helper function that queries the SQLite database to retrieve a specific document by category and name. Called by the handler with category='objects'.def get_document(category: str, name: str) -> Dict[str, str] | None: """Get a specific document. Args: category: Category name (tags, filters, or objects) name: Document name Returns: Document data or None if not found """ conn = sqlite3.connect(DB_PATH) cursor = conn.cursor() cursor.execute( f""" SELECT name, title, category, content, path FROM {DOCS_TABLE} WHERE category = ? AND name = ? """, (category, name), ) row = cursor.fetchone() conn.close() if row: return { "name": row[0], "title": row[1], "category": row[2], "content": row[3], "path": row[4], } return None