Skip to main content
Glama
Receipt Sweep

Receipt Sweep

by saranya-ms

read_pdf_attachment

Read-only

Extract text from a PDF email attachment, such as a receipt, when the email body only says it's attached. Use the message ID and filename to retrieve the PDF text.

Instructions

Extract the text of a PDF attachment, such as an emailed receipt.

Use this when read_email lists a PDF attachment and the body only says something like "your receipt is attached".

Args: message_id: The message ID from search_emails results. filename: The PDF's filename (from read_email's attachments list). folder: The folder the message is in.

Returns the PDF's text, or an error message.

Input Schema

NameRequiredDescriptionDefault
folderNoINBOX
filenameYes
message_idYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior3/5

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

readOnlyHint=true already establishes the safe-read profile, so the description's burden is lighter. It adds modest behavioral context – that failures surface as 'an error message' and that the args must be sourced from prior tool results – but says nothing about size limits, scanned/image PDFs, or parsing behavior beyond the text return already covered by the output schema.

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?

Front-loaded with purpose, then usage, then a compact Args block. Nothing is padded and each block is one to two lines.

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?

With readOnlyHint covering safety and an output schema covering return values, the description only needs to supply purpose, trigger, and parameter sourcing – all of which are present. An agent has everything required to call this tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must carry all parameter meaning, and it does: every one of the three args is documented, and two of them name their provenance ('message ID from search_emails results', 'filename from read_email's attachments list'). This is meaningfully more than the bare schema property names.

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?

The description gives a specific verb + resource ('Extract the text of a PDF attachment') and grounds it with a concrete example ('an emailed receipt'). It implicitly differentiates from read_email by describing the extraction step, but never distinguishes itself from the sibling save_attachment, which also operates on attachments.

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

Usage Guidelines4/5

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

It states a clear trigger condition: use this when read_email lists a PDF attachment but the body only says something like 'your receipt is attached'. That is a concrete when-to-use rule, though it gives no explicit when-not or alternative (e.g. when to use save_attachment instead).

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