extract_tables pulls tables out of a document as Markdown (the default — it renders as a real table in chat, VS Code and GitHub) or as JSON rows for programmatic use. Example prompt: “Extract the tables from invoice.pdf.”
Tool description (as the AI agent sees it):
Extracts tables from a document and returns them as Markdown (default) or JSON. Supports PDF, DOCX, XLSX, PPTX, HTML, and other tabular formats. Markdown tables render instantly in VS Code, GitHub, and AI chat — use this format to visually review table data right in the response. Use format=‘json’ to get a structured array of rows for programmatic processing or further manipulation. Call this tool immediately whenever the user asks to extract, read, or view tables from a document. Do NOT pre-check whether files exist — just pass the filename the user provided. Returns either a Markdown document (multiple ### Table N (page N, R×C) sections) or a JSON array of { table, page, rows, columns, data: string[][] } objects. On failure, the response text starts with ‘Table extraction failed for’ followed by the underlying exception type, message, and inner-exception chain.