Skip to main content
Glama

create_invoice

Generate professional invoices in FreshBooks by specifying customer details and line items with quantities and costs.

Instructions

Create a new invoice. Lines format: [{"name": "Service", "description": "...", "qty": 1, "unit_cost": {"amount": "100.00", "code": "USD"}}]

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
customer_idYes
linesYes
due_offset_daysNo
currency_codeNoUSD
notesNo
po_numberNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The 'create_invoice' handler function, responsible for creating a new invoice in FreshBooks using the accounting client.
    async def create_invoice(
        customer_id: int,
        lines: list[dict],
        due_offset_days: int = 30,
        currency_code: str = "USD",
        notes: str = "",
        po_number: str = "",
    ) -> str:
        """Create a new invoice. Lines format: [{"name": "Service", "description": "...", "qty": 1, "unit_cost": {"amount": "100.00", "code": "USD"}}]"""
        data = {
            "customerid": customer_id,
            "create_date": _today(),
            "due_offset_days": due_offset_days,
            "currency_code": currency_code,
            "lines": lines,
        }
        if notes:
            data["notes"] = notes
        if po_number:
            data["po_number"] = po_number
        result = await client.accounting_create("invoices/invoices", "invoice", data)
        inv = result.get("invoice", result)
        return f"Invoice #{inv.get('invoice_number', '?')} created (ID: {inv.get('id')}). Amount: ${inv.get('amount', {}).get('amount', '0')}"
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions the creation action but doesn't describe permissions needed, whether the invoice becomes immediately payable, what happens on failure, rate limits, or what the output contains. The example format is helpful but doesn't constitute comprehensive behavioral transparency for a creation tool.

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 concise with two sentences: one stating the purpose and one providing a concrete example. The example is front-loaded and directly relevant. No wasted words, though the JSON formatting could be more readable. Every sentence earns its place by providing essential information.

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 that there's an output schema (which reduces the need to describe return values), no annotations, and 6 parameters with 0% schema coverage, the description is moderately complete. It covers the most complex parameter (lines) with an example but leaves others unexplained. For a creation tool with multiple parameters, this represents a significant gap in completeness despite the output schema.

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%, so the description must compensate. It provides a detailed example for the 'lines' parameter structure, which is valuable semantic information not in the schema. However, it doesn't explain the other 5 parameters (customer_id, due_offset_days, currency_code, notes, po_number) at all. The partial compensation earns a baseline score.

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 action ('Create a new invoice') and provides a concrete example of the required data structure. It distinguishes from siblings like 'update_invoice' or 'send_invoice' by specifying creation rather than modification or communication. However, it doesn't explicitly differentiate from 'create_estimate' which might have similar structure.

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?

No guidance on when to use this tool versus alternatives like 'create_estimate' or 'create_client'. The description provides no context about prerequisites (e.g., needing an existing customer), appropriate scenarios, or when other tools might be more suitable. It simply states what the tool does without usage 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/AlexlaGuardia/MCP-Freshbooks'

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