Skip to main content
Glama

create_payment

Record payments against FreshBooks invoices by specifying amount, date, and payment type to update financial records and track revenue.

Instructions

Record a payment against an invoice. Amount as string. Date as YYYY-MM-DD. Types: Check, Credit, Cash, Bank Transfer, Credit Card, PayPal, ACH, Other.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
invoice_idYes
amountYes
dateYes
payment_typeNoOther
noteNo
currency_codeNoUSD

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function that executes the creation of a payment in FreshBooks.
    async def create_payment(
        invoice_id: int,
        amount: str,
        date: str,
        payment_type: str = "Other",
        note: str = "",
        currency_code: str = "USD",
    ) -> str:
        """Record a payment against an invoice. Amount as string. Date as YYYY-MM-DD. Types: Check, Credit, Cash, Bank Transfer, Credit Card, PayPal, ACH, Other."""
        data = {
            "invoiceid": invoice_id,
            "amount": {"amount": amount, "code": currency_code},
            "date": date,
            "type": payment_type,
        }
        if note:
            data["note"] = note
        result = await client.accounting_create("payments/payments", "payment", data)
        p = result.get("payment", result)
        return f"Payment of ${amount} recorded against invoice {invoice_id} (Payment ID: {p.get('id')})"
  • The MCP tool registration for create_payment using the @mcp.tool() decorator.
    @mcp.tool()
    @_handle_errors
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 states 'Record a payment,' implying a write operation, but doesn't cover critical aspects like permissions needed, whether the action is reversible, rate limits, or what the response contains. The format hints (e.g., 'Date as YYYY-MM-DD') are useful but insufficient for a mutation 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 front-loaded with the core purpose and efficiently provides key details in a single sentence. It avoids redundancy, but could be slightly more structured (e.g., separating format hints from the purpose statement) for optimal clarity.

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 handles return values), the description's main gaps are in usage guidelines and behavioral transparency for a mutation tool. It covers basic parameter semantics but lacks context on when and how to use the tool effectively, making it minimally adequate but incomplete.

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 adds value by explaining 'Amount as string' and 'Date as YYYY-MM-DD,' and lists payment types, which clarifies some parameters beyond the bare schema. However, it doesn't cover all parameters (e.g., 'invoice_id,' 'note,' 'currency_code'), leaving gaps in documentation.

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 verb ('Record a payment') and resource ('against an invoice'), making the purpose specific and understandable. However, it doesn't explicitly differentiate this tool from sibling tools like 'list_payments' or 'send_invoice', which would require a 5.

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 doesn't mention prerequisites (e.g., invoice must exist), exclusions, or comparisons with sibling tools like 'list_payments' or 'update_invoice', leaving the agent with minimal context for decision-making.

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