How to check a document's pages before rendering them

get_view_info answers the questions that decide what to render: what kind of file this is, how many pages it has, and how big each page is. It renders nothing, so it is fast and cheap.

Note
The commands and config snippets on this page are for the .NET build of the server — the only platform available today. Installation and client setup: MCP server for .NET. Other platforms will expose the same tools with their own launch command; everything else on this page applies unchanged.

The prompt

What is contract.docx — how many pages, and what page size?

The result names the file type, the page count, and the width and height of every page. The sizes are in points: 612 × 792 is US Letter, about 595 × 842 is A4.

Why it matters

  • Page numbers. render_page accepts any number, so the page count is the only guard against rendering a page that does not exist.
  • Mixed layouts. A document with one landscape page among portrait pages shows it in the sizes. That is often the table or the drawing someone is asking about.
  • Spreadsheets. A sheet can paginate into many more pages than you expect. Knowing the number first keeps the agent from rendering all of them.

Protected documents

A password-protected file needs its password on every call. Give it up front:

The password for contract.pdf is in my message. Check how many pages it has, then show me page 2.

Without it the call fails, and the agent can ask you for the password instead of guessing.

When the file is not found

Pass the file name, not a full path from your machine. If the name does not match, the response lists the files the server can see, so the agent can correct itself.