Skip to main content
Glama

scan_gmail_years

Scan completed Gmail periods for receipts. In eligible split-tax-year accounts, a number is the period's ending year (2025 = 2024–25 tax year); otherwise it is a calendar year. Use returned tax-period labels and inclusive ISO bounds. Long-running: the first eligible period starts immediately; the rest queue one at a time (each full period typically takes hours; the app may close). Preview without confirmStart (no scan starts), ask the user to confirm, then start with confirmStart:true. For recent receipts (~60 days), use scan_gmail. The in-progress period cannot be year-scanned; use get_scan_status for progress.

Input Schema

NameRequiredDescriptionDefault
yearsYesCompleted periods; ending year for eligible tax-year accounts (2025 = 2024–25), calendar year otherwise. Max 10.
accountEmailNoOptional: which connected Gmail inbox to scan (multi-inbox users). Defaults to the primary.
confirmStartNoOmit or false = preview only (no scan starts). Must be exactly true to start scanning.

Output Schema

NameRequiredDescriptionDefault
accountNo
messageYes
previewNo
successYes
eligibleNo
gmailUrlNo
scanningNo
notEligibleNo
queuedYearsNo
startedYearNo
alreadyQueuedNo
alreadyScannedNo
archiveThroughYearNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / years / description
      Previous value: -"Completed prior years to scan, e.g. [2020, 2021]. Max 10."New value: +"Completed periods; ending year for eligible tax-year accounts (2025 = 2024–25), calendar year otherwise. Max 10."
  2. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "allOf": [
      +    {
      +      "if": {
      +        "properties": {
      +          "preview": {
      +            "const": true
      +          }
      +        },
      +        "required": [
      +          "preview"
      +        ]
      +      },
      +      "then": {
      +        "required": [
      +          "account",
      +          "eligible",
      +          "alreadyScanned",
      +          "notEligible"
      +        ]
      +      }
      +    }
      +  ],
      +  "properties": {
      +    "account": {
      +      "type": "string"
      +    },
      +    "alreadyQueued": {
      +      "items": {
      +        "type": "integer"
      +      },
      +      "type": "array"
      +    },
      +    "alreadyScanned": {
      +      "items": {
      +        "type": "integer"
      +      },
      +      "type": "array"
      +    },
      +    "archiveThroughYear": {
      +      "type": "integer"
      +    },
      +    "eligible": {
      +      "items": {
      +        "type": "integer"
      +      },
      +      "type": "array"
      +    },
      +    "gmailUrl": {
      +      "type": "string"
      +    },
      +    "message": {
      +      "type": "string"
      +    },
      +    "notEligible": {
      +      "items": {
      +        "additionalProperties": true,
      +        "properties": {
      +          "code": {
      +            "type": "string"
      +          },
      +          "reason": {
      +            "type": "string"
      +          },
      +          "year": {
      +            "type": "integer"
      +          }
      +        },
      +        "required": [
      +          "year",
      +          "reason"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "preview": {
      +      "type": "boolean"
      +    },
      +    "queuedYears": {
      +      "items": {
      +        "type": "integer"
      +      },
      +      "type": "array"
      +    },
      +    "scanning": {
      +      "items": {
      +        "type": "integer"
      +      },
      +      "type": "array"
      +    },
      +    "startedYear": {
      +      "type": [
      +        "integer",
      +        "null"
      +      ]
      +    },
      +    "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.8/5.0
Behavior5/5

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

Annotations only declare readOnlyHint=false, openWorldHint=true, destructiveHint=false. The description goes well beyond them, disclosing that the operation is long-running, that the first eligible period starts immediately while the rest queue sequentially, that each period can take hours, and that the app may close mid-run — exactly the kind of risk context an agent needs before triggering a write.

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-loads purpose, then year semantics, then the long-running/queueing behavior, then the confirmation workflow, then alternatives. Dense but every sentence carries distinct information; slightly long, which is justified by the genuinely complex async behavior but not maximally tight.

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?

An output schema exists, so return values need no explanation. Given the multi-step confirmation flow, hours-long async execution, and queue semantics, the description covers everything an agent needs to call this correctly and warn the user.

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 workflow meaning the schema cannot: the preview-vs-start distinction for confirmStart and the tax-year vs calendar-year interpretation of years values, tied to returned tax-period labels. It largely echoes the schema's own wording for these fields, keeping it 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 ('Scan completed Gmail periods for receipts') and immediately scopes it against the sibling: recent receipts (~60 days) belong to scan_gmail, and in-progress periods cannot be year-scanned. An agent can route between the Gmail scanning siblings without opening any 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 when-to-use (completed periods), when-not (in-progress period, recent ~60 days), named alternatives (scan_gmail, get_scan_status), and a concrete precondition workflow: preview without confirmStart, ask the user, then start with confirmStart:true.

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.