When a document is too large for the context window, convert only the part you need. GroupDocs.Markdown.Mcp lets an AI agent turn selected pages or worksheets into Markdown locally, from Claude Desktop, Claude Code, Cursor or GitHub Copilot, so the LLM reads one chapter and not the whole book:

Convert pages 40 to 52 of handbook.pdf to Markdown.

The step-by-step version with config and troubleshooting is in the documentation: How to convert just one section of a document to Markdown.

What does scoped conversion save?

Every word you put in a prompt is read, billed by the model provider and competes for attention with every other word. Most questions about a long document concern a small part of it. Converting everything first, then asking the model to ignore most of it, pays for the whole document on every question.

The saving is easy to measure on a document you own. Here is one real measurement, with its method stated. The file is the Markdown source of this server’s own licensing page in the documentation. We split it after the front matter and counted whitespace-separated words, code blocks and Hugo shortcode markup included (the whole page is 810 words without the shortcodes). The table illustrates the ratio between a section and its page; it is not a measured result of the pages option, which selects pages, not headings:

Section of the page Words
Introduction and the three licensing modes 167
Evaluation mode limitations 93
Applying a license 78
Metered (pay-per-use) licensing 366
Confirming which mode is active 113
Getting a license 27
Whole page 844

A question about which licensing mode is active needs only the 113-word section. That is about 13 percent of the page, or roughly 7.5 times shorter than the whole. The count is in words because tokens depend on the model’s tokenizer; the token count moves with the word count, and we have not put a token figure here that we did not measure. The page is short on purpose. Your handbook will be larger, and the ratio is yours to count.

Way 1: Which pages can I name directly?

If you know the pages, say so. pages on convert_to_markdown takes a comma-separated list of 1-based numbers, such as "40,41,42". There is no range syntax in the parameter; the agent expands “40 to 52” into the list for you. Leave pages out and the whole document converts.

Convert pages 40 to 52 of handbook.pdf to Markdown.

The result is a saved .md file and the content returned inline. Long output is truncated inline, and the saved file holds the full text.

Way 2: How do I convert only chapter 3?

The tool has no heading-scoped option, so “chapter 3” has to become page numbers first. Do it in two small steps:

How many pages does handbook.pdf have, and what is its title?

get_document_info answers from the file without converting it: pageCount, title, author, fileFormat and isEncrypted. It also tells you early if a password is needed. Next, convert the table-of-contents pages, read them, and ask for the range they name.

Example session (abridged):

You:   How many pages does handbook.pdf have, and what is its title?
Agent: get_document_info -> pageCount: 212, title: "Operations Handbook".
You:   Convert pages 3 to 4 (the table of contents), then convert chapter 3.
Agent: convert_to_markdown (pages: "3,4") -> contents read: chapter 3 runs pages 61 to 64.
       convert_to_markdown (pages: "61,62,63,64") -> saved chapter 3 as Markdown.

Two small conversions replace one enormous one.

Way 3: How do I take one worksheet from a workbook?

In XLSX, XLS and ODS files the numbers select worksheets, not printed pages:

Convert worksheet 2 of the model to Markdown.

That puts one table into the document without the other sheets that sit in the same workbook.

When is a scoped conversion worth the extra step?

  • Context. The LLM receives the part that answers the question, and long documents stay inside the window.
  • Metered cost. Under metered licensing you are billed for what you process, so fewer pages is a lower bill.
  • Retrieval quality. An index holding the one relevant appendix is not diluted by the rest of the back catalogue on every query.

If the whole document is the job, do not scope. Convert it once and keep the Markdown.

Honest limits: pages in evaluation mode

Without a license the server runs in evaluation mode: only the first 3 pages are processed, with an evaluation watermark on each. This overrides pages. Asking for pages 40 to 52 in evaluation mode returns pages 1 to 3 without an error, so a chapter from the middle of a book is not possible to test unlicensed. If the output does not start where you expected, call get_license_status first.

A table of contents can use printed page labels. If the converted pages do not start at the expected heading, ask the agent to convert neighbouring pages and adjust the list; get_document_info gives the total page count, which bounds the list.

FAQ

How do I convert only chapter 3 to Markdown?

Find the page numbers of the chapter first, then pass them in pages. Ask the agent to convert the table-of-contents pages, read them, and request the range they give.

What do I do when a document is too large for the context window?

Convert part of the document, not all of it. Use pages to select the pages or worksheets that answer your question, and check the page count with get_document_info before you start.

Can I convert PDF pages 10 to 20 to Markdown with AI?

Yes. Ask in plain language, “Convert pages 10 to 20 of report.pdf to Markdown”, and the agent sends the expanded list of page numbers. Unlicensed, only the first 3 pages are processed.

Go deeper