Skip to main content
Glama
alveyautomation

qbo-mcp

qbo_search_vendors

Search for vendors in QuickBooks Online by matching any part of their display name. Returns vendor list and count.

Instructions

Search vendors by display name (substring, case-insensitive).

Args: query: Free-text fragment matched against Vendor.DisplayName. limit: Cap on returned vendors (1-1000, default 50).

Returns: JSON envelope: {"ok": true, "data": {"vendors": [...], "count": N}}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
limitNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The MCP tool function 'qbo_search_vendors' registered with @mcp.tool(). Validates input, calls client.search_vendors(), returns JSON envelope.
    @mcp.tool()
    def qbo_search_vendors(query: str, limit: int = 50) -> str:
        """Search vendors by display name (substring, case-insensitive).
    
        Args:
            query: Free-text fragment matched against Vendor.DisplayName.
            limit: Cap on returned vendors (1-1000, default 50).
    
        Returns:
            JSON envelope: {"ok": true, "data": {"vendors": [...], "count": N}}.
        """
        if not query or not query.strip():
            return _err("query is required and must be non-empty")
        try:
            capped = max(1, min(limit, 1000))
            vendors = _get_client().search_vendors(query=query.strip(), limit=capped)
            return _ok(
                {
                    "vendors": vendors,
                    "count": len(vendors),
                    "query": query.strip(),
                    "limit": capped,
                }
            )
        except (ValueError, QBOError, RuntimeError) as exc:
            return _err(str(exc))
  • Parameters: query (str, required), limit (int, default 50). Returns JSON with vendors list and count.
    """Search vendors by display name (substring, case-insensitive).
    
    Args:
        query: Free-text fragment matched against Vendor.DisplayName.
        limit: Cap on returned vendors (1-1000, default 50).
    
    Returns:
        JSON envelope: {"ok": true, "data": {"vendors": [...], "count": N}}.
    """
  • Registered via @mcp.tool() decorator on FastMCP instance 'mcp' (line 24).
    @mcp.tool()
  • Client-side search_vendors() builds a QBO query with LIKE clause on DisplayName, delegates to _paginate_query.
    def search_vendors(
        self, query: str, *, limit: int = 50
    ) -> list[dict]:
        """Search active vendors by display name (substring, case-insensitive)."""
        if not query or not query.strip():
            raise ValueError("query must be non-empty")
        safe = _escape_qbo_string(query.strip())
        where = f"DisplayName LIKE '%{safe}%'"
        return list(
            self._paginate_query(
                select_clause="SELECT * FROM Vendor",
                entity="Vendor",
                where=where,
                order_by="DisplayName",
                limit=limit,
            )
        )
  • _escape_qbo_string() escapes special characters (backslash, single-quote, underscore) for QBO string literals in LIKE expressions.
    def _escape_qbo_string(value: str) -> str:
        """Escape characters that would break a QBO string literal.
    
        QBO's query language uses single quotes for strings and a backslash as
        the escape character for both `'` and `\\`. `%` and `_` are also
        metacharacters inside `LIKE` expressions; we leave `%` alone so that
        callers don't lose substring semantics, but escape `_` so a literal
        underscore in a customer name doesn't silently match anything.
        """
        return (
            value.replace("\\", "\\\\")
            .replace("'", "\\'")
            .replace("_", "\\_")
        )
Behavior4/5

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

With no annotations, the description carries full burden and adequately discloses the search behavior: substring, case-insensitive matching on DisplayName. It also specifies the return envelope format. However, it omits potential error conditions or limitations beyond the cap.

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

Conciseness5/5

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

The description is extremely concise: a one-sentence purpose followed by structured Args and Returns sections. Every sentence adds value without redundancy, ideal for quick agent parsing.

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

Completeness5/5

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

Given the tool's simplicity (2 parameters, no nested objects) and the presence of an output schema (with return format described), the description covers the complete input-output contract. It includes the query behavior, parameter defaults, and response structure.

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

Parameters5/5

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

Schema description coverage is 0%, but the description fully compensates by explaining each parameter: 'Free-text fragment matched against Vendor.DisplayName' for query and 'Cap on returned vendors (1-1000, default 50)' for limit, adding essential meaning beyond the schema.

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

Purpose5/5

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

The description explicitly states 'Search vendors by display name (substring, case-insensitive)', providing a specific verb and resource with search criteria. It naturally distinguishes from sibling tools like qbo_get_vendor (single vendor fetch) and qbo_search_customers (different resource).

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 does not provide guidance on when to use this tool versus alternatives such as qbo_get_vendor, qbo_search_customers, or qbo_search_invoices. It lacks explicit when-to-use or when-not-to-use instructions, leaving the agent to infer from context.

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/alveyautomation/qbo-mcp'

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