Skip to main content
Glama
mcp-ledger-server-ts

mcp-ledger-server-ts

by Gurmeher23

Get invoice

get_invoice
Read-onlyIdempotent

Fetches one invoice with its line items and any recorded routing decision by invoice ID, returning NOT_FOUND for unknown IDs.

Instructions

Fetch one invoice with its line items (sku, quantity, unit price in minor units) and any routing decision already recorded. Read-only. Errors with NOT_FOUND if the id is unknown.

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": {
      "invoiceId": "<invoiceId>"
    },
    "name": "get_invoice"
  }
}

Input Schema

NameRequiredDescriptionDefault
invoiceIdYesLedger invoice id, e.g. "inv_003". Obtain ids from list_invoices.

Output Schema

NameRequiredDescriptionDefault
invoiceYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive and closed-world, so the safety profile is covered. The description adds genuine value beyond that: it discloses the returned payload shape (line items with sku, quantity, unit price in minor units, plus routing decision) and the NOT_FOUND error on unknown ids. The remaining gap is minor, since the output schema carries the full return contract.

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?

Three short sentences, zero waste, with the core action front-loaded and the error contract placed last where it is easy to scan. Every clause earns its place: payload, safety, failure mode.

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 single-parameter read with full annotation coverage and an output schema, the description supplies everything an agent needs beyond structured fields: what comes back in domain terms (minor units, routing decision) and the failure mode. Nothing material is missing.

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%, and the invoiceId parameter is already documented with pattern, length bounds, an example, and provenance (list_invoices). The description adds nothing about the parameter, so the baseline of 3 applies.

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?

"Fetch one invoice with its line items ... and any routing decision" states a specific verb (fetch), resource (invoice), and scope (single record), which implicitly contrasts with the list_invoices sibling. It stops short of naming siblings explicitly, so an agent must infer the single-vs-list distinction rather than being told.

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

Usage Guidelines3/5

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

Usage is only implied: the tool takes an id, so an agent infers it should be called when it already has an invoice id. There is no explicit statement of when to prefer this over list_invoices or match_invoice_to_po, and no exclusions. The schema's mention of list_invoices as an id source helps but is not in the description.

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