Files and questions
The four tools every LEX AI mode shares: reading customer data files as markdown, rasterizing PDF pages with no text layer, and putting a question to the user with the answer's origin recorded.
Files and questions
Two jobs come up in every mode: reading the customer's own data files, and asking the user something the assistant cannot decide alone. LEX AI handles both with server-side tools that are registered on all ten surfaces from one shared definition, so they behave identically whichever mode you are in.
Reading a data file
read_input_file reads a file from disk and returns it as markdown. Seven formats are detected automatically from the extension: .csv, .tsv, .txt, .xlsx, .xlsm, .xls and .pdf. Each Excel sheet becomes one markdown table under its own heading; each PDF page becomes text under a per-page heading.
The alternative is what assistants do without it — write a throwaway pandas script and read the schema out of the terminal. That fails outright on Copilot in JetBrains and on a sandboxed Codex, and where it does work it floods the transcript with output nobody reads.
- Windowed, not truncated blindly — one call returns at most 40,000 characters, with
truncatedandnext_offsetso the rest can be fetched deliberately. The largest file accepted is 200 MB. - Content-addressed — every read returns the file's sha256, and converted text is cached by content hash, so re-reading an unchanged file is free.
- Magic bytes are checked for
xlsx,xlsm,xlsandpdf, so a file with the wrong extension is refused with an explanation instead of being mis-parsed. An empty or unreadable file is refused too. - Column names survive verbatim — only the pipe character is escaped. A prettified column name is one the application will never match.
Pages with no text layer
render_pdf_pages rasterizes PDF pages as images so a multimodal host model can read a scan, a chart or a stamp. It renders three pages per call by default, grayscale at 1.5x, or color at 3x with detail="high".
It also reports pages_without_text and points out which requested pages could have been read as text far more cheaply, because a rendered page costs one to two orders of magnitude more than the same page as text. Anything read off pixels is a transcription, and the tool warns that a figure obtained this way must not be recorded as exact without the user confirming it.
Every reader ships with the server as a hard dependency, so the path works offline with no system packages and no setup on the customer's side.
Asking the user
ask_user_question puts a single question to the user and record_user_answer records the reply. The channel is a three-rung ladder that degrades silently and can never fail the tool call:
- A host dialog, where the IDE can render one.
- A local loopback HTML form, otherwise.
- Plain text relayed by the assistant, as the last resort.
What matters is the difference between them. An answer collected by the host or the form is recorded with an origin of user — the model never authored it. An answer the assistant types in is recorded as relayed. The two are never collapsed into one, and if the user submitted the loopback form, their words outrank anything the assistant passes for the same question.
record_user_answer(declined=true) requires an explicit assumption to be supplied, so a question the user would not answer leaves a disclosed gap in the run record rather than a hidden default. One dialog stays open for at most 120 seconds.
Settings
Variable | Controls | Default |
|---|---|---|
| Characters one |
|
| Largest file that will be converted |
|
| Pages |
|
| Seconds one question dialog may stay open |
|
| Where converted text is cached | system temp |
See Tool surfaces for the rest of what each mode exposes, and Execution model for how these calls sit inside a run.
Was this helpful?
Your feedback shapes what we write next.
