Skip to main content
Glama

create_expense

Add business expenses to FreshBooks by specifying amount, date, category, and staff details for accurate financial tracking.

Instructions

Create a new expense. Amount as string (e.g. '150.00'). Date as YYYY-MM-DD.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
category_idYes
staff_idYes
amountYes
dateYes
vendorNo
notesNo
currency_codeNoUSD
client_idNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The create_expense function acts as the handler for the 'create_expense' tool. It constructs the expense data, calls the accounting_create method via the client, and returns a confirmation message with the new expense ID.
    async def create_expense(
        category_id: int,
        staff_id: int,
        amount: str,
        date: str,
        vendor: str = "",
        notes: str = "",
        currency_code: str = "USD",
        client_id: int | None = None,
    ) -> str:
        """Create a new expense. Amount as string (e.g. '150.00'). Date as YYYY-MM-DD."""
        data = {
            "categoryid": category_id,
            "staffid": staff_id,
            "amount": {"amount": amount, "code": currency_code},
            "date": date,
        }
        if vendor:
            data["vendor"] = vendor
        if notes:
            data["notes"] = notes
        if client_id:
            data["clientid"] = client_id
        result = await client.accounting_create("expenses/expenses", "expense", data)
        e = result.get("expense", result)
        return f"Expense created (ID: {e.get('id')}). Amount: ${amount}"
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states this is a creation operation, implying it's a write/mutation tool, but doesn't mention permission requirements, whether the operation is idempotent, what happens on failure, or what the response contains. The format hints for amount and date are useful but don't cover broader behavioral traits like error handling or side effects.

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 brief and front-loaded with the core purpose. The two format examples are directly relevant to parameter usage. There's no wasted text, though it could be slightly more structured (e.g., separating purpose from parameter notes).

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 this is a mutation tool with 8 parameters, 0% schema description coverage, no annotations, but with an output schema (which reduces need to describe return values), the description is moderately complete. It covers the purpose and two parameter formats but misses behavioral context, usage guidelines, and documentation for most parameters. The output schema helps but doesn't fully compensate for the gaps.

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 format guidance for 'amount' (string like '150.00') and 'date' (YYYY-MM-DD), which adds meaningful context beyond the bare schema. However, it doesn't mention the other 6 parameters (category_id, staff_id, vendor, notes, currency_code, client_id), leaving most parameters undocumented in both schema and description.

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 expense') and resource ('expense'), making the purpose immediately understandable. It distinguishes from siblings like 'get_expense' or 'list_expenses' by specifying creation rather than retrieval. However, it doesn't explicitly differentiate from other creation tools like 'create_client' or 'create_invoice' beyond the resource type.

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., needing valid category_id or staff_id), doesn't specify when this is appropriate versus other expense-related tools like 'get_expense' or 'list_expenses', and offers no exclusion criteria or contextual boundaries.

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