Skip to main content
Glama

list_liquid_objects

Discover available Shopify Liquid objects organized by category to identify which data variables can be used in theme templates.

Instructions

List all available Shopify Liquid objects.

Returns: List of all object names with titles organized by category

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for list_liquid_objects tool. Decorated with @mcp.tool() for registration and schema inference from signature and docstring. Retrieves objects from database via get_by_category and categorizes them for output.
    @mcp.tool() def list_liquid_objects() -> str: """List all available Shopify Liquid objects. Returns: List of all object names with titles organized by category """ docs = get_by_category("objects") if not docs: return "No objects found in database" output = [f"Available Liquid Objects ({len(docs)} total):\n"] # Group by category core = [] product_related = [] cart_related = [] customer_related = [] content = [] other_objects = [] for doc in docs: name = doc["name"] title = doc["title"] item = f"- **{name}**: {title}" if name in ["shop", "settings", "theme", "request", "routes"]: core.append(item) elif "product" in name or "variant" in name or "collection" in name: product_related.append(item) elif "cart" in name or "checkout" in name or "line_item" in name: cart_related.append(item) elif "customer" in name or "company" in name: customer_related.append(item) elif name in ["page", "blog", "article", "articles", "comment"]: content.append(item) else: other_objects.append(item) if core: output.append("**Core Objects:**") output.extend(core) output.append("") if product_related: output.append("**Product Related:**") output.extend(product_related) output.append("") if cart_related: output.append("**Cart & Checkout:**") output.extend(cart_related) output.append("") if customer_related: output.append("**Customer Related:**") output.extend(customer_related) output.append("") if content: output.append("**Content:**") output.extend(content) output.append("") if other_objects: output.append("**Other Objects:**") output.extend(other_objects[:15]) if len(other_objects) > 15: output.append(f" ... and {len(other_objects) - 15} more") return "\n".join(output)
  • The @mcp.tool() decorator registers the list_liquid_objects function as an MCP tool, automatically generating schema from function signature and docstring.
    @mcp.tool()
  • Docstring providing the tool description and return type description used for schema generation.
    """List all available Shopify Liquid objects. Returns: List of all object names with titles organized by category """
  • Helper function get_by_category used by list_liquid_objects to fetch all documents of category 'objects' from the SQLite database.
    def get_by_category(category: str) -> List[Dict[str, str]]: """Get all documents in a category. Args: category: Category name (tags, filters, or objects) Returns: List of documents in that category """ conn = sqlite3.connect(DB_PATH) cursor = conn.cursor() cursor.execute( f""" SELECT name, title, category, content, path FROM {DOCS_TABLE} WHERE category = ? ORDER BY name """, (category,), ) results = [] for row in cursor.fetchall(): results.append( { "name": row[0], "title": row[1], "category": row[2], "content": row[3], "path": row[4], } ) conn.close() return results

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/shopify-liquid-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server