Skip to main content
Glama

process_gmail_receipts

Process specific Gmail emails as receipts when the user supplies Gmail message IDs; to find receipts use scan_gmail. No server preview: on call each email is converted to PDF, extracted by AI and added to the user's expense spreadsheet. Max 25 emails per request. Requires Gmail connected in ExpenseBot.

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": {
      "emailIds": "<emailIds>"
    },
    "name": "process_gmail_receipts"
  }
}

Input Schema

NameRequiredDescriptionDefault
emailIdsYesGmail message IDs to process as receipts
accountEmailNoOptional: which Gmail account to use (for users with multiple linked accounts)

Output Schema

NameRequiredDescriptionDefault
dataNo
errorNo
messageYes
successYes
emailCountNo
processInfoNo
submissionIdNo
processedItemsNo
spreadsheetUrlNo
reviewExpensesUrlNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changed
    • removedOutput schema / properties / data / additionalProperties
      Removed value: -true
    • removedOutput schema / properties / emailCount / minimum
      Removed value: -0
    • removedOutput schema / properties / processInfo / additionalProperties
      Removed value: -true
    • removedOutput schema / properties / processInfo / properties
      Removed value: -{
      -  "processingCompleted": {
      -    "type": "boolean"
      -  },
      -  "sessionId": {
      -    "type": "string"
      -  },
      -  "status": {
      -    "type": "string"
      -  }
      -}
    • removedOutput schema / properties / processedItems / items / additionalProperties
      Removed value: -true
  2. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "properties": {
      +    "data": {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    "emailCount": {
      +      "minimum": 0,
      +      "type": "integer"
      +    },
      +    "error": {
      +      "type": "string"
      +    },
      +    "message": {
      +      "type": "string"
      +    },
      +    "processInfo": {
      +      "additionalProperties": true,
      +      "properties": {
      +        "processingCompleted": {
      +          "type": "boolean"
      +        },
      +        "sessionId": {
      +          "type": "string"
      +        },
      +        "status": {
      +          "type": "string"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "processedItems": {
      +      "items": {
      +        "additionalProperties": true,
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "reviewExpensesUrl": {
      +      "type": "string"
      +    },
      +    "spreadsheetUrl": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "submissionId": {
      +      "type": "string"
      +    },
      +    "success": {
      +      "type": "boolean"
      +    }
      +  },
      +  "required": [
      +    "success",
      +    "message"
      +  ],
      +  "type": "object"
      +}
  3. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -{
      -  "additionalProperties": true,
      -  "description": "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.",
      -  "properties": {
      -    "data": {
      -      "additionalProperties": true,
      -      "description": "Structured payload. Shape varies per tool — common keys: total, breakdown, comparison, sampleMeta, ids, expenseId, reportId, signupUrl, results.",
      -      "type": "object"
      -    },
      -    "error": {
      -      "additionalProperties": true,
      -      "description": "Present only when success === false.",
      -      "properties": {
      -        "code": {
      -          "type": "string"
      -        },
      -        "hint": {
      -          "type": "string"
      -        },
      -        "message": {
      -          "type": "string"
      -        }
      -      },
      -      "type": "object"
      -    },
      -    "message": {
      -      "description": "Human-readable result text. Always present on success; prefer rendering this verbatim before any further reasoning.",
      -      "type": "string"
      -    },
      -    "sampleMeta": {
      -      "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"
      -    },
      -    "success": {
      -      "description": "False on tool errors; check before reading `data`.",
      -      "type": "boolean"
      -    }
      -  },
      -  "type": "object"
      -}New value: +null
  4. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Annotations only declare readOnlyHint=false and openWorldHint=true; the description goes much further by disclosing that there is no server-side preview and that each call converts to PDF, runs AI extraction, and writes to the user's expense spreadsheet. The 25-email cap and account-connection requirement are side-effect and eligibility facts the annotations do not 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?

Three sentences, each dense and front-loaded: purpose and alternative first, then the no-preview behavior and side effects, then the hard limits. No filler or restatement of the title.

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?

Output schema exists, so return values need not be explained; the description covers the pieces an agent cannot get elsewhere: precondition, batch limit, no-preview irreversibility of the write, and the downstream destination of the data. Complete for a 2-parameter, single-required-argument mutation tool.

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 100%, so the baseline is 3, but the description adds a real constraint the schema lacks: a maximum of 25 emails per request, which changes how many IDs an agent should batch. The accountEmail parameter is only implied by 'Requires Gmail connected', so it does not fully compensate beyond the stated limit.

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?

The description gives a specific verb and resource (process Gmail emails as receipts) plus the input condition (user supplies Gmail message IDs). It also explicitly names the sibling responsible for the other half of the job, so the agent can separate this from scan_gmail 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?

It states the triggering condition (user supplies message IDs) and routes the discovery case to scan_gmail explicitly. Prerequisites (Gmail connected in ExpenseBot) and the batch ceiling of 25 are named inline, leaving little to inference.

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.