Skip to main content
Glama
norman-finance

Norman Finance MCP Server

Official

update_transaction

Modify details of an existing transaction, including amount, description, category, date, VAT rate, sale type, supplier country, and cashflow type, using the Norman Finance MCP Server.

Instructions

Update an existing transaction.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
amountNo
cashflow_typeNo
categoryNo
category_idNo
dateNo
descriptionNo
sale_typeNo
supplier_countryNo
transaction_idYes
vat_rateNo

Implementation Reference

  • The core handler function for the 'update_transaction' tool. Includes inline schema definitions via Pydantic Field descriptions and the execution logic that updates the transaction via the Norman API.
    @mcp.tool() async def update_transaction( ctx: Context, transaction_id: str = Field(description="Public ID of the transaction to update"), amount: Optional[float] = Field(description="Transaction amount (positive for income, negative for expense)"), description: Optional[str] = Field(description="Transaction description"), category: Optional[str] = Field(description="Transaction category"), date: Optional[str] = Field(description="Transaction date in YYYY-MM-DD format (defaults to today)"), vat_rate: Optional[int] = Field(description="VAT rate (0, 7, 19)"), sale_type: Optional[str] = Field(description="Sale type (GOODS, SERVICES)"), supplier_country: Optional[str] = Field(description="Country of the supplier (DE, INSIDE_EU, OUTSIDE_EU)"), cashflow_type: Optional[str] = Field(description="Cashflow type of the transaction (INCOME, EXPENSE)"), category_id: Optional[str] = Field(description="Category ID of the transaction (If not provided, the transaction will be categorized automatically using AI)"), ) -> Dict[str, Any]: """Update an existing transaction.""" api = ctx.request_context.lifespan_context["api"] company_id = api.company_id if not company_id: return {"error": "No company available. Please authenticate first."} transaction_url = urljoin( config.api_base_url, f"api/v1/companies/{company_id}/accounting/transactions/{transaction_id}/" ) # Prepare update data update_data = {} if amount is not None: update_data["amount"] = abs(amount) if cashflow_type == "INCOME" else -abs(amount) if description is not None: update_data["description"] = description if category is not None: update_data["category"] = category if date is not None: update_data["valueDate"] = date if vat_rate is not None: update_data["vatRate"] = vat_rate if sale_type is not None: update_data["saleType"] = sale_type if sale_type else "" if supplier_country is not None: update_data["supplierCountry"] = supplier_country if cashflow_type is not None: update_data["cashflowType"] = cashflow_type if category_id is not None: update_data["category"] = category_id return api._make_request("PATCH", transaction_url, json_data=update_data)
  • Input schema for the update_transaction tool defined using Pydantic Fields with descriptions.
    async def update_transaction( ctx: Context, transaction_id: str = Field(description="Public ID of the transaction to update"), amount: Optional[float] = Field(description="Transaction amount (positive for income, negative for expense)"), description: Optional[str] = Field(description="Transaction description"), category: Optional[str] = Field(description="Transaction category"), date: Optional[str] = Field(description="Transaction date in YYYY-MM-DD format (defaults to today)"), vat_rate: Optional[int] = Field(description="VAT rate (0, 7, 19)"), sale_type: Optional[str] = Field(description="Sale type (GOODS, SERVICES)"), supplier_country: Optional[str] = Field(description="Country of the supplier (DE, INSIDE_EU, OUTSIDE_EU)"), cashflow_type: Optional[str] = Field(description="Cashflow type of the transaction (INCOME, EXPENSE)"), category_id: Optional[str] = Field(description="Category ID of the transaction (If not provided, the transaction will be categorized automatically using AI)"), ) -> Dict[str, Any]:
  • Registration call that invokes register_transaction_tools(server), which defines and registers the update_transaction tool along with other transaction tools.
    register_transaction_tools(server)

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/norman-finance/norman-mcp-server'

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