Skip to main content
Glama

scan_gmail_years

provider:outlook returns a handoff; never starts. 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.

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": {
      "years": "<years>"
    },
    "name": "scan_gmail_years"
  }
}

Input Schema

NameRequiredDescriptionDefault
yearsYesCompleted periods; ending year for eligible tax-year accounts (2025 = 2024–25), calendar year otherwise. Max 10.
providerNoDefault Gmail.
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
providerNo
scanningNo
notEligibleNo
queuedYearsNo
startedYearNo
alreadyQueuedNo
scanInitiatedNo
alreadyScannedNo
archiveThroughYearNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • addedInput schema / properties / provider
      Added value: +{
      +  "description": "Default Gmail.",
      +  "enum": [
      +    "gmail",
      +    "outlook"
      +  ],
      +  "type": "string"
      +}
    • addedOutput schema / properties / provider
      Added value: +{
      +  "enum": [
      +    "gmail",
      +    "outlook"
      +  ],
      +  "type": "string"
      +}
    • addedOutput schema / properties / scanInitiated
      Added value: +{
      +  "type": "boolean"
      +}
  2. 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."
  3. 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"
      +}
  4. 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
  5. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Beyond annotations, it discloses that this is long-running, that the first eligible period starts immediately, that remaining periods queue one at a time, that each can take hours, and that the app may close. It also explains the preview/confirmStart safety behavior and the outlook handoff exception, which are meaningful operational traits.

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?

The description is dense but appropriately sized for a long-running, stateful scanning tool with a confirmation gate. It is mostly front-loaded, though the edge-case provider warning appears before the main purpose rather than after it.

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?

It covers the tool's purpose, year semantics, provider exception, long-running queue behavior, preview/confirmStart workflow, sibling alternatives, and progress-checking via get_scan_status. With an output schema present, it does not need to explain return values, and no critical agent-facing context appears 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 100%, so the baseline is 3, but the description adds useful meaning for the years parameter in split-tax-year accounts and clarifies that provider:outlook is only a handoff that never starts. Much of the confirmStart behavior is also in the schema, but the provider nuance and year interpretation add value beyond structured fields.

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 first substantive clause states a specific verb and resource: scanning completed Gmail periods for receipts. It also distinguishes this from scan_gmail for recent receipts and get_scan_status for progress, so an agent can identify the correct tool without opening sibling schemas.

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?

The description explicitly says when to use scan_gmail instead (~60 days), when to use get_scan_status, and when year-scanning is not possible because a period is in progress. It also gives the required preview-then-confirmStart workflow, 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.