Skip to main content
Glama
alveyautomation

qbo-mcp

qbo_get_invoice

Retrieve full invoice details, including line items, by providing the invoice ID. Returns the invoice record or null if not found.

Instructions

Fetch full invoice detail including line items.

Args: invoice_id: QBO Invoice.Id.

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
invoice_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The MCP tool handler function. Registered with @mcp.tool(), it receives an invoice_id, validates it, delegates to _get_client().get_invoice(), and returns a JSON envelope.
    @mcp.tool()
    def qbo_get_invoice(invoice_id: str) -> str:
        """Fetch full invoice detail including line items.
    
        Args:
            invoice_id: QBO Invoice.Id.
    
        Returns:
            JSON envelope. `data` is the invoice record, or null on 404.
        """
        if not invoice_id or not str(invoice_id).strip():
            return _err("invoice_id is required and must be non-empty")
        try:
            invoice = _get_client().get_invoice(str(invoice_id).strip())
            return _ok(invoice)
        except (ValueError, QBOError, RuntimeError) as exc:
            return _err(str(exc))
  • The QBOClient.get_invoice() method that performs the actual HTTP GET request to QBO's invoice/{invoice_id} endpoint. Handles 404 by returning None.
    def get_invoice(self, invoice_id: str) -> dict | None:
        """Fetch one invoice by Id, or None on 404."""
        if not invoice_id or not str(invoice_id).strip():
            raise ValueError("invoice_id must be non-empty")
        try:
            data = self._request("GET", f"invoice/{invoice_id}")
        except QBOError as exc:
            if exc.status_code == 404:
                return None
            raise
        return data.get("Invoice")
  • The @mcp.tool() decorator on line 220 registers qbo_get_invoice as an MCP tool.
    @mcp.tool()
Behavior3/5

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

With no annotations, the description carries the full burden. It discloses a read operation returning null on 404, which is helpful. However, it omits any mention of permissions, rate limits, or side effects beyond the basic retrieval 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 short but structured with Args and Returns sections, and the main purpose is front-loaded. No extraneous text. It earns a high score for efficiency, though could be slightly more terse.

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

Completeness4/5

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

For a simple single-parameter tool with an output schema (though not shown), the description covers the key behavior: fetching full details, handling 404, and the return envelope. It is complete enough for an agent to understand the tool's basic role.

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

Parameters3/5

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

Schema description coverage is 0%, but the description states 'invoice_id: QBO Invoice.Id,' adding meaning that it is the identifier type. This partially compensates for the lack of schema descriptions, but no further details on format or constraints are provided.

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 full invoice detail including line items,' which is a specific verb and resource. It distinguishes from sibling tools like qbo_search_invoices (for listing) and qbo_get_customer (for different resource) by targeting a single invoice 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 you have an invoice_id and need full details, but it does not explicitly contrast with search_invoices or provide when-not-to-use scenarios. No explicit guidance on alternatives is given.

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