Skip to main content
Glama
alveyautomation

qbo-mcp

qbo_get_vendor

Retrieve the complete record of a specific vendor from QuickBooks Online by providing the vendor ID. Returns vendor data or null if not found.

Instructions

Fetch the full record for a single vendor.

Args: vendor_id: QBO Vendor.Id.

Returns: JSON envelope. data is the vendor record, or null on 404.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
vendor_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The MCP tool handler function for qbo_get_vendor. Validates vendor_id, calls the client's get_vendor method, and returns JSON envelope.
    @mcp.tool()
    def qbo_get_vendor(vendor_id: str) -> str:
        """Fetch the full record for a single vendor.
    
        Args:
            vendor_id: QBO Vendor.Id.
    
        Returns:
            JSON envelope. `data` is the vendor record, or null on 404.
        """
        if not vendor_id or not str(vendor_id).strip():
            return _err("vendor_id is required and must be non-empty")
        try:
            vendor = _get_client().get_vendor(str(vendor_id).strip())
            return _ok(vendor)
        except (ValueError, QBOError, RuntimeError) as exc:
            return _err(str(exc))
  • The @mcp.tool() decorator registers qbo_get_vendor as an MCP tool on the FastMCP instance.
    @mcp.tool()
  • The function signature `(vendor_id: str) -> str` defines the input schema (one required string parameter) and output type.
    @mcp.tool()
  • The QBOClient.get_vendor method that performs the actual QBO API request. Returns the vendor dict or None on 404.
    def get_vendor(self, vendor_id: str) -> dict | None:
        """Fetch one vendor by Id, or None on 404."""
        if not vendor_id or not str(vendor_id).strip():
            raise ValueError("vendor_id must be non-empty")
        try:
            data = self._request("GET", f"vendor/{vendor_id}")
        except QBOError as exc:
            if exc.status_code == 404:
                return None
            raise
        return data.get("Vendor")
  • Helper functions used by the tool: _get_client() creates/lazy-loads the QBO client; _ok() and _err() format the JSON response envelope.
    def _get_client() -> QBOClient:
        global _settings, _client
        if _client is None:
            _settings = Settings.from_env()
            _client = QBOClient(
                client_id=_settings.client_id,
                client_secret=_settings.client_secret,
                refresh_token=_settings.refresh_token,
                realm_id=_settings.realm_id,
                api_host=_settings.api_host,
                token_url=QBO_TOKEN_URL,
                minor_version=_settings.minor_version,
                timeout=_settings.http_timeout,
                max_retries=_settings.max_retries,
            )
        return _client
    
    
    def _ok(data: Any) -> str:
        return json.dumps({"ok": True, "data": data}, default=_json_default, indent=2)
    
    
    def _err(message: str) -> str:
        return json.dumps({"ok": False, "error": message}, indent=2)
    
    
    def _json_default(value: Any) -> Any:
        if isinstance(value, (date, datetime)):
            return value.isoformat()
        raise TypeError(f"Object of type {type(value).__name__} is not JSON serializable")
Behavior4/5

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

With no annotations, the description discloses the return format (JSON envelope with 'data'), specifies null on 404, and implies read-only behavior. This provides sufficient transparency, though could mention idempotency.

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 two sentences plus structured Args/Returns, front-loading the main purpose. Every sentence adds value with no redundant information.

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 output schema exists, the description still provides essential details (null on 404) and parameter clarification. It is complete for the tool's complexity.

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?

Schema coverage is 0%, but the description adds 'QBO Vendor.Id' to clarify the vendor_id parameter. This explains the exact value required, compensating for the lack of schema descriptions.

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 clearly states 'Fetch the full record for a single vendor', specifying the action, resource, and scope. It distinguishes from sibling QBO tools like qbo_search_vendors by focusing on a single vendor retrieval.

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

Usage Guidelines3/5

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

The description implies use when a vendor ID is available, but does not explicitly state when to use this tool versus alternatives like qbo_search_vendors. No when-not or alternative guidance is provided.

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