Skip to main content
Glama
norman-finance

Norman Finance MCP Server

Official

link_transaction

Associate a specific transaction with an invoice using invoice and transaction IDs. Streamlines accounting workflows by connecting financial records for accurate tracking and reporting.

Instructions

Link a transaction to an invoice.

Args:
    invoice_id: ID of the invoice
    transaction_id: ID of the transaction to link
    
Returns:
    Response from the link transaction request

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
invoice_idYes
transaction_idYes

Implementation Reference

  • The core handler function for the 'link_transaction' tool. It is decorated with @mcp.tool() for registration and implements the logic to link a transaction ID to an invoice ID via a POST request to the Norman API.
    @mcp.tool() 
    async def link_transaction(
        ctx: Context,
        invoice_id: str,
        transaction_id: str
    ) -> Dict[str, Any]:
        """
        Link a transaction to an invoice.
        
        Args:
            invoice_id: ID of the invoice
            transaction_id: ID of the transaction to link
            
        Returns:
            Response from the link transaction request
        """
        api = ctx.request_context.lifespan_context["api"]
        company_id = api.company_id
        
        if not company_id:
            return {"error": "No company available. Please authenticate first."}
            
        link_url = urljoin(
            config.api_base_url,
            f"api/v1/companies/{company_id}/invoices/{invoice_id}/link-transaction/"
        )
        
        link_data = {
            "transaction": transaction_id
        }
        
        return api._make_request("POST", link_url, json_data=link_data)
  • Top-level registration call to register_invoice_tools(server), which includes the registration of the link_transaction tool via its @mcp.tool() decorator.
    register_invoice_tools(server)
  • Import of register_invoice_tools from invoices.py in the main server.py file.
    from norman_mcp.tools.invoices import register_invoice_tools
  • Docstring providing the input schema (arguments) and output description for the link_transaction tool.
    """
    Link a transaction to an invoice.
    
    Args:
        invoice_id: ID of the invoice
        transaction_id: ID of the transaction to link
        
    Returns:
        Response from the link transaction request
    """

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