Skip to main content
Glama
klodr

mercury-invoicing-mcp

mercury_get_transaction_attachment

Read-only

Obtain the pre-signed download URL(s) for a transaction's receipts / attachments.

Instructions

Obtain the pre-signed download URL(s) for a transaction's receipts / attachments.

USE WHEN: you actually intend to download a receipt — filing a supplier invoice, attaching a justification to a bookkeeping entry. Locate candidates first with mercury_list_transactions (hasAttachment: true), then call this for the one you want.

DO NOT USE: to check whether a receipt exists — mercury_list_transactions already reports hasAttachment without minting a credential. Do not call it across a whole statement to pre-fetch URLs: they expire in ~12 hours and every one you mint is a live bearer token sitting in transcripts and logs.

SIDE EFFECTS: none on Mercury (read-only). But the returned URL grants unauthenticated access to the document for ~12 hours to anyone who holds it — treat the response as a secret and do not echo it further than needed.

RETURNS: { transactionId, attachmentCount, attachments: [{ fileName, attachmentType, url }] }.

Input Schema

NameRequiredDescriptionDefault
fileNameNoReturn only the attachment with this exact file name. Omit to return all.
accountIdYesThe Mercury account ID
transactionIdYesThe transaction ID

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.20.3

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Goes well beyond the readOnlyHint=true annotation by disclosing that the returned URL is an unauthenticated bearer token valid ~12 hours, that it should be treated as a secret, and that pre-fetching mints expiring credentials into logs. This is exactly the kind of non-obvious risk context the description should carry.

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?

Front-loaded with the purpose sentence, then cleanly sectioned into USE WHEN / DO NOT USE / SIDE EFFECTS / RETURNS. Despite its length, every section earns its place and nothing is redundant.

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

Completeness5/5

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

No output schema exists, but the RETURNS block supplies the exact response shape ({ transactionId, attachmentCount, attachments: [{ fileName, attachmentType, url }] }), and the security/expiry caveats cover the openWorld risk. An agent has everything needed to call it safely.

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 100%, so accountId, transactionId, and fileName are already documented in the schema; the description adds no syntax or format detail. Baseline 3 applies since the schema does the heavy lifting for parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (obtain) and resource (pre-signed download URLs for a transaction's receipts/attachments), and distinguishes itself from mercury_list_invoice_attachments and mercury_list_transactions by scoping to a single transaction's attachments.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit USE WHEN (intending to actually download) and DO NOT USE (just checking whether a receipt exists) sections, plus a named alternative (mercury_list_transactions with hasAttachment: true) for locating candidates and a warning against bulk pre-fetching. Nothing is left to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.