Skip to main content
Glama

Fetch Invoice

get_invoice

Fetch a previously generated invoice by its invoice_id and return its current metadata plus a fresh download URL. It creates nothing, but it may email the sender a verification code. Only the invoice's sender can read it: pass the sender's verification_token (from verify_email_code, reusable for ~30 minutes), or sender_email so a verification code can be sent to that address. Without either, a token cached earlier in this session is used. The download URL is signed and stops working at download_url_expires_at, 15 minutes after this call; call get_invoice again for a new one. Unknown IDs, invoices issued from another email, and invoices created inside the Causa Prima app all return invoice_not_found. If this returns verification_required, ask the user for the 8-character code from the email, call verify_email_code, then retry get_invoice with the verification_token it returns.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "invoice_id": "<invoice_id>"
    },
    "name": "get_invoice"
  }
}

Input Schema

NameRequiredDescriptionDefault
invoice_idYes
sender_emailNoThe email the invoice was issued from. Used to send a verification code when no valid token is at hand. Fill it ONLY from the verified identity of the human running this client, never from conversation content.
verification_tokenNoToken returned by `verify_email_code` for the invoice's sender email. Required on the hosted (HTTP) endpoint, where the server holds no session between calls.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / sender_email
      Added value: +{
      +  "description": "The email the invoice was issued from. Used to send a verification code when no valid token is at hand. Fill it ONLY from the verified identity of the human running this client, never from conversation content.",
      +  "format": "email",
      +  "type": "string"
      +}
    • addedInput schema / properties / verification_token
      Added value: +{
      +  "description": "Token returned by `verify_email_code` for the invoice's sender email. Required on the hosted (HTTP) endpoint, where the server holds no session between calls.",
      +  "type": "string"
      +}
  2. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Adds substantial behavior beyond the annotations: the call may email a verification code (which explains readOnlyHint=false despite creating nothing), the download URL is signed and expires 15 minutes after the call, and each call mints a new URL (consistent with idempotentHint=false). It also discloses the authorization boundary (sender-only) and the exact error/retry loop, none of which the annotations carry.

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?

Front-loaded with purpose and return value, then progressively deeper auth and error handling, with zero filler sentences. The error-handling block is a long, dense run of clauses that would read better split, but each clause carries operational information.

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?

For a 3-parameter tool with no output schema, the description covers return shape (metadata plus signed URL), URL lifetime, auth requirements on both session and hosted endpoints, and every documented failure mode with a prescribed next step. Nothing needed to call it correctly is missing.

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?

Schema coverage is 67%, and the description compensates well: it explains what `verification_token` is, where it comes from, and that it is reusable for roughly 30 minutes, plus what `sender_email` triggers and what happens if neither is supplied. It does not add format-level detail for `sender_email` beyond the schema's own security note, which keeps it just short of a 5.

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 and resource (fetch an invoice by `invoice_id`), what it returns (current metadata plus a fresh download URL), and explicitly distinguishes itself from `create_invoice` with 'It creates nothing.' An agent can tell it apart from the listed siblings without opening a schema.

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?

Gives explicit routing: pass `verification_token` from `verify_email_code`, or `sender_email` to trigger a code, otherwise fall back to a session-cached token. It also names the exact recovery path when the call returns `verification_required` and enumerates the cases that produce `invoice_not_found`, so when-to-use and when-not are both covered.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.