Skip to main content
Glama

get_last_receipt_result

Read-only

Read the authoritative outcome of a receipt batch: a submit_receipt batch by its exact ID (submissionId), or the latest upload (including in-app) via withinSeconds. Poll at the returned interval/time allowance (small batch at least 5 minutes; larger longer). Pending is normal: never blindly resubmit. found:false = pending/no terminal verdict; found:true = terminal. Returns added/duplicate/skipped/held_for_review/errored per-file outcomes, exact counts and up to 10 summaries. Held files (missing details or a possible duplicate) were not added; relay only their message's next step (use the returned Review files link), do not invent a missing card or direct held uploads to Gmail Action Needed. Show spreadsheetUrl/reviewExpensesUrl for rows actually added, not for held files. Unknown outcomes stay unknown. Gmail scans use get_scan_status. Read-only.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "get_last_receipt_result"
  }
}

Input Schema

NameRequiredDescriptionDefault
submissionIdNoExact submissionId returned by submit_receipt. Strongly preferred because it binds the result to this upload instead of an earlier receipt.
withinSecondsNoLookback seconds for the latest upload when there is no submissionId.

Output Schema

NameRequiredDescriptionDefault
dataNo
foundYes
stateNoPresent on pending polls for a specific submission.
countsNo
messageYes
successYes
verdictNoTerminal only. held_for_review: every file was held, none added; mixed also covers batches with held files.
receiptsNoProcessed receipt summaries. Held files are not listed here; see data.outcomes.
timestampNo
submissionIdNo
spreadsheetUrlNo
reviewExpensesUrlNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / withinSeconds / description
      Previous value: -"Fallback lookback window when submissionId is unavailable (30-3600 seconds; default 600)."New value: +"Lookback seconds for the latest upload when there is no submissionId."
  2. Changed1 schema field changed
    • changedOutput schema / properties / verdict / description
      Previous value: -"Terminal branch only. held_for_review: every file was held for review, so none was added. mixed also covers any batch that includes held files."New value: +"Terminal only. held_for_review: every file was held, none added; mixed also covers batches with held files."
  3. Changed4 schema fields changed
    • addedOutput schema / properties / counts / properties / heldForReview
      Added value: +{
      +  "description": "Files held for review and not added. Present only when at least one.",
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • addedOutput schema / properties / receipts / description
      Added value: +"Processed receipt summaries. Held files are not listed here; see data.outcomes."
    • changedOutput schema / properties / verdict / description
      Previous value: -"Terminal branch only."New value: +"Terminal branch only. held_for_review: every file was held for review, so none was added. mixed also covers any batch that includes held files."
    • changedOutput schema / properties / verdict / enum
      Previous value: -[
      -  "added",
      -  "duplicate",
      -  "skipped",
      -  "errored",
      -  "mixed",
      -  "unknown"
      -]New value: +[
      +  "added",
      +  "duplicate",
      +  "skipped",
      +  "errored",
      +  "mixed",
      +  "unknown",
      +  "held_for_review"
      +]
  4. Changed18 schema fields changed
    • addedOutput schema / allOf
      Added value: +[
      +  {
      +    "if": {
      +      "properties": {
      +        "found": {
      +          "const": true
      +        }
      +      },
      +      "required": [
      +        "found"
      +      ]
      +    },
      +    "then": {
      +      "required": [
      +        "verdict",
      +        "counts",
      +        "receipts",
      +        "submissionId",
      +        "spreadsheetUrl",
      +        "reviewExpensesUrl",
      +        "data",
      +        "timestamp"
      +      ]
      +    }
      +  }
      +]
    • changedOutput schema / description
      Previous value: -"Standard ExpenseBot tool result envelope. `message` is the human-readable summary the AI cites; `data` is the structured payload (totals, breakdowns, ids, etc.). On failure, `success` is false and `error` carries a code/message/hint triple."New value: +"found:false means processing is still pending; found:true is a terminal result."
    • addedOutput schema / properties / counts
      Added value: +{
      +  "additionalProperties": true,
      +  "properties": {
      +    "added": {
      +      "minimum": 0,
      +      "type": "integer"
      +    },
      +    "duplicates": {
      +      "minimum": 0,
      +      "type": "integer"
      +    },
      +    "errors": {
      +      "minimum": 0,
      +      "type": "integer"
      +    },
      +    "skipped": {
      +      "minimum": 0,
      +      "type": "integer"
      +    },
      +    "submitted": {
      +      "minimum": 0,
      +      "type": "integer"
      +    }
      +  },
      +  "required": [
      +    "submitted",
      +    "added",
      +    "duplicates",
      +    "skipped",
      +    "errors"
      +  ],
      +  "type": "object"
      +}
    • removedOutput schema / properties / data / description
      Removed value: -"Structured payload. Shape varies per tool — common keys: total, breakdown, comparison, sampleMeta, ids, expenseId, reportId, signupUrl, results."
    • removedOutput schema / properties / error
      Removed value: -{
      -  "additionalProperties": true,
      -  "description": "Present only when success === false.",
      -  "properties": {
      -    "code": {
      -      "type": "string"
      -    },
      -    "hint": {
      -      "type": "string"
      -    },
      -    "message": {
      -      "type": "string"
      -    }
      -  },
      -  "type": "object"
      -}
    • addedOutput schema / properties / found
      Added value: +{
      +  "type": "boolean"
      +}
    • removedOutput schema / properties / message / description
      Removed value: -"Human-readable result text. Always present on success; prefer rendering this verbatim before any further reasoning."
    • addedOutput schema / properties / receipts
      Added value: +{
      +  "items": {
      +    "additionalProperties": true,
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • addedOutput schema / properties / reviewExpensesUrl
      Added value: +{
      +  "type": "string"
      +}
    • removedOutput schema / properties / sampleMeta
      Removed value: -{
      -  "additionalProperties": true,
      -  "description": "Set when the underlying dataset was truncated. isTruncated=true means the agent saw a sample of `sampleCount` of `totalCount` rows; aggregate totals are still accurate.",
      -  "properties": {
      -    "isTruncated": {
      -      "type": "boolean"
      -    },
      -    "sampleCount": {
      -      "type": "integer"
      -    },
      -    "totalCount": {
      -      "type": "integer"
      -    }
      -  },
      -  "type": "object"
      -}
    • addedOutput schema / properties / spreadsheetUrl
      Added value: +{
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
    • addedOutput schema / properties / state
      Added value: +{
      +  "const": "processing",
      +  "description": "Present on pending polls for a specific submission.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / submissionId
      Added value: +{
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
    • addedOutput schema / properties / success / const
      Added value: +true
    • removedOutput schema / properties / success / description
      Removed value: -"False on tool errors; check before reading `data`."
    • addedOutput schema / properties / timestamp
      Added value: +{
      +  "format": "date-time",
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
    • addedOutput schema / properties / verdict
      Added value: +{
      +  "description": "Terminal branch only.",
      +  "enum": [
      +    "added",
      +    "duplicate",
      +    "skipped",
      +    "errored",
      +    "mixed",
      +    "unknown"
      +  ],
      +  "type": "string"
      +}
    • addedOutput schema / required
      Added value: +[
      +  "success",
      +  "found",
      +  "message"
      +]
  5. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only declare readOnlyHint/openWorldHint/destructiveHint; the description goes well beyond by explaining that pending is normal, how found:false vs found:true map to verdicts, that unknown outcomes stay unknown, and that held files were not added. It also discloses result shape (per-file outcomes, exact counts, up to 10 summaries) and what URLs may legitimately be shown.

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?

Dense but front-loaded: purpose first, then polling guidance, then result interpretation, then held-file handling. Nearly every clause carries operational value, though the held-file/Gmail Action Needed instructions are stacked tightly and could be trimmed slightly for readability.

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 polling/outcome tool with an output schema present, the description still supplies the interpretive layer an agent needs: retry cadence, pending vs terminal semantics, per-file categories, and constraints on acting on held files. Nothing required to call and interpret it correctly 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 coverage is 100% and both parameters already carry descriptions, including the 'strongly preferred' rationale for submissionId and the lookback meaning of withinSeconds. The description only restates the same semantics (exact ID binding, latest-upload lookback), adding no format or edge-case detail the schema lacks, so baseline 3 applies.

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?

Opens with a specific verb+resource: read the authoritative outcome of a receipt batch, then defines both input modes (submit_receipt batch by submissionId, or latest upload via withinSeconds). It also explicitly distinguishes itself from a sibling ('Gmail scans use get_scan_status'), so the agent knows this is not the scan-status tool.

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 when-to-use and when-not-to-use rules: use this for receipt batches, use get_scan_status for Gmail scans, and preference for submissionId because it binds results to this upload rather than an earlier receipt. It also prescribes polling behavior ('poll at the returned interval/time allowance') and prohibits a wrong action ('never blindly resubmit').

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.