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
| Name | Required | Description | Default |
|---|---|---|---|
| attachment_id | Yes | ||
| transaction_id | Yes |
Implementation Reference
- norman_mcp/tools/documents.py:420-450 (handler)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")
- norman_mcp/tools/documents.py:420-420 (registration)The @mcp.tool() decorator registers this function as an MCP tool.async def link_attachment_transaction(