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
    """
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 the action ('link') but does not explain what linking entails (e.g., whether it's a mutating operation, if it requires specific permissions, or what happens on failure). This leaves critical behavioral traits unspecified, making it inadequate for informed use.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured and concise, with a clear purpose statement followed by separate Args and Returns sections. Every sentence serves a specific function without redundancy, making it easy to parse and understand quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a linking operation with no annotations and no output schema, the description is incomplete. It fails to explain the behavior, potential side effects, error handling, or return value details, leaving significant gaps for an agent to use the tool effectively in context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description explicitly lists and names both parameters ('invoice_id' and 'transaction_id') in the Args section, adding meaning beyond the input schema, which has 0% description coverage. This clarifies what each parameter represents, though it does not provide format details or validation rules, keeping it from a perfect 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 ('link') and the resources involved ('transaction' and 'invoice'), making the purpose immediately understandable. However, it does not differentiate this tool from sibling tools like 'link_attachment_transaction', which might also involve linking operations, leaving some ambiguity about its specific role in the toolset.

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, such as when linking is necessary compared to creating or updating transactions/invoices. It lacks context on prerequisites, error conditions, or typical workflows, offering minimal usage direction beyond the basic action.

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

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

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