Skip to main content
Glama

search_liquid_docs

Search Shopify Liquid documentation to find tags, filters, and objects for theme development and templating tasks.

Instructions

Search Shopify Liquid documentation using full-text search.

Args: queries: List of search terms (maximum 3)

Returns: Formatted search results with snippets

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queriesYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function for the 'search_liquid_docs' tool, decorated with @mcp.tool() which also serves as registration. It processes the input queries, calls the helper search_documentation, and formats the search results into a readable string output.
    @mcp.tool()
    def search_liquid_docs(queries: List[str]) -> str:
        """Search Shopify Liquid documentation using full-text search.
    
        Args:
            queries: List of search terms (maximum 3)
    
        Returns:
            Formatted search results with snippets
        """
        if not queries:
            return "Error: Please provide at least one search query"
    
        # Limit to 3 queries
        queries = queries[:3]
    
        logger.info(f"Searching for: {queries}")
        results = search_documentation(queries, limit=10)
    
        if not results:
            return f"No results found for: {', '.join(queries)}"
    
        # Format results
        output = [f"Found {len(results)} results for: {', '.join(queries)}\n"]
    
        for i, doc in enumerate(results, 1):
            output.append(f"{i}. **{doc['title']}** ({doc['category']})")
            output.append(f"   Path: {doc['path']}")
            if doc.get("snippet"):
                output.append(f"   {doc['snippet']}")
            output.append("")
    
        return "\n".join(output)
  • Helper utility that implements the core full-text search logic using SQLite FTS5 virtual table, generating snippets with highlights, and returning structured results used by the tool handler.
    def search_documentation(queries: List[str], limit: int = 10) -> List[Dict[str, str]]:
        """Search documentation using FTS5.
    
        Args:
            queries: List of search terms
            limit: Maximum number of results to return
    
        Returns:
            List of matching documents with metadata
        """
        conn = sqlite3.connect(DB_PATH)
        cursor = conn.cursor()
    
        # Build FTS5 query
        search_query = " OR ".join(queries[:3])  # Limit to 3 queries like Gemini example
    
        cursor.execute(
            f"""
            SELECT d.name, d.title, d.category, d.content, d.path,
                   snippet({FTS_TABLE}, 3, '<mark>', '</mark>', '...', 64) as snippet
            FROM {FTS_TABLE} fts
            JOIN {DOCS_TABLE} d ON fts.rowid = d.id
            WHERE {FTS_TABLE} MATCH ?
            ORDER BY rank
            LIMIT ?
        """,
            (search_query, limit),
        )
    
        results = []
        for row in cursor.fetchall():
            results.append(
                {
                    "name": row[0],
                    "title": row[1],
                    "category": row[2],
                    "content": row[3],
                    "path": row[4],
                    "snippet": row[5],
                }
            )
    
        conn.close()
        return results
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions 'maximum 3' for queries, which adds a constraint, but fails to cover other critical aspects like rate limits, authentication needs, error handling, or pagination. For a search tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded with the core purpose in the first sentence. The 'Args' and 'Returns' sections add structure without redundancy, making it efficient. However, the formatting could be slightly improved for better readability.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (1 parameter, no nested objects) and the presence of an output schema (which handles return values), the description is somewhat complete. It covers the purpose and parameter semantics but lacks usage guidelines and behavioral details, making it adequate but with clear gaps for effective agent use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds meaningful semantics beyond the input schema: it specifies that 'queries' are 'List of search terms' and includes a 'maximum 3' constraint, which is not in the schema (schema description coverage is 0%). This compensates well for the low schema coverage, though it could elaborate on term formatting or examples.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose as 'Search Shopify Liquid documentation using full-text search,' which specifies the verb (search), resource (Shopify Liquid documentation), and method (full-text search). However, it doesn't explicitly differentiate from sibling tools like get_liquid_filter or list_liquid_filters, which might retrieve specific documentation items rather than performing searches.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It lacks any mention of sibling tools (e.g., get_liquid_filter for direct retrieval or list_liquid_filters for listing) or context for when full-text search is preferred over other methods, leaving the agent without usage direction.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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