Skip to main content
Glama
norman-finance

Norman Finance MCP Server

Official

link_attachment_transaction

Associate a transaction with an attachment by providing their respective IDs. This tool streamlines financial record-keeping by enabling clear linkages between documents and transactions in Norman Finance.

Instructions

Link a transaction to an attachment.

Args:
    attachment_id: ID of the attachment
    transaction_id: ID of the transaction to link
    
Returns:
    Response from the link transaction request

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
attachment_idYes
transaction_idYes

Implementation Reference

  • The handler function that implements the 'link_attachment_transaction' tool. It takes attachment_id and transaction_id, constructs the API URL, and makes a POST request to link the transaction to the attachment.
    async def link_attachment_transaction(
        ctx: Context,
        attachment_id: str = Field(description="ID of the attachment"),
        transaction_id: str = Field(description="ID of the transaction to link")
    ) -> Dict[str, Any]:
        """
        Link a transaction to an attachment.
        
        Args:
            attachment_id: ID of the attachment
            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}/attachments/{attachment_id}/link-transaction/"
        )
        
        link_data = {
            "transaction": transaction_id
        }
        
        return api._make_request("POST", link_url, json_data=link_data) 
  • Pydantic Field definitions providing input schema and descriptions for the tool parameters.
    attachment_id: str = Field(description="ID of the attachment"),
    transaction_id: str = Field(description="ID of the transaction to link")
  • The @mcp.tool() decorator registers this function as an MCP tool.
    async def link_attachment_transaction(
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 the action ('Link') but doesn't describe what happens upon linking (e.g., whether it's reversible, if it affects data integrity, or if it requires specific permissions). The vague return statement ('Response from the link transaction request') adds no useful context about success/error behavior or output format.

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 appropriately brief and front-loaded with the core purpose in the first sentence. The Args/Returns sections are structured but somewhat redundant with the schema. The return statement is vague and could be more informative without adding length.

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 (a mutation tool with 2 parameters), lack of annotations, and no output schema, the description is incomplete. It doesn't cover behavioral aspects like side effects, error conditions, or return values, leaving the agent with insufficient context to use the tool safely and effectively.

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 lists both parameters ('attachment_id' and 'transaction_id') and specifies they are IDs, which adds basic semantics beyond the schema's type-only definitions. However, it doesn't explain ID formats, sources, or validation rules, leaving significant gaps in parameter understanding.

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 ('Link') and the resources involved ('a transaction to an attachment'), making the purpose immediately understandable. It distinguishes this from sibling tools like 'link_transaction' (which likely links transactions to other entities) by specifying attachment linkage. However, it doesn't fully explain what 'linking' means operationally (e.g., establishing a reference, metadata association).

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., existing attachment and transaction IDs), exclusions, or compare it to similar tools like 'link_transaction' or 'create_attachment'. The agent must infer usage from the tool name alone.

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