Skip to main content

Read bounded attachment and knowledge content

Enable the required tool in Complexity after selecting your owned mailbox. Every tool needs its separate group grant, chat selection, MailGen license, and current permission.

ToolInput and defaultsPermissionResult limit
readMailAttachmentemailId, attachmentId, optional byteOffset=0, byteLimit=16384mail.readUp to 16 KiB from an active owned message's persisted attachment.
readSyncArchiveAttachmentImmutable messageId, attachmentId, optional same byte windowmail.sync.readUp to 16 KiB from an owned, unpurged read-only archive attachment.
readKnowledgeFilefileId, optional ordinal=0, limit=10knowledge.readAt most 10 extracted chunks, each up to 1,600 characters.

Inputs contain canonical IDs and bounded pagination, not storage keys, URLs, ownership, or model-supplied bytes. Byte limits range from 1 through 16384. Knowledge limits range from 1 through 10.

Knowledge access needs library ownership or a current tenant group read share. Search, manage, and outbound rights do not replace read access. The tools exclude deleted files, folders, and libraries. The backend rechecks status and access after reading chunks.

Canonical reading paths​

GET /getAttachmentContent and GET /sync/permanent-delete-archive accept byteOffset and byteLimit together for bounded JSON. Ordinary human download and preview remain available. Archive windows require mailbox, message, and attachment IDs.

After owner and lifecycle checks, the backend slices stored bytes or requests a native S3 range. Results contain metadata, totalBytes, byteOffset, returnedBytes, nextOffset, and base64 contentBytes. BFF checks canonical base64, actual byte count, and pagination consistency.

Supported text formats with valid UTF-8 also return passive text. Binary or invalid UTF-8 receives no invented text. nextOffset: null marks the end.

S3 uses Range: bytes=start-end. Responses need valid 206 and Content-Range, correct actual size, and at most 16 KiB. The reader rejects an ignored Range before buffering the body. No unbounded fallback exists. Microsoft attachment aliases resolve through parent/owner filters, never arbitrary Graph URLs.

GET /knowledge/content reads stored knowledge_chunks by ordinal. Each page checks ready state and read access. Both route policies require knowledge.read. It retains document/page/sheet/section citations and nextOrdinal.

GET /knowledge/file remains the human original-byte download. The tool reads extracted text. Request the next window for truncated content. Do not treat excerpts as complete sources.