Skip to main content
Glama
Nextcloud MCP Server

Nextcloud MCP Server

by stack74

Read file content

nextcloud_read_file
Read-onlyIdempotent

Read a file's contents from Nextcloud, including text, PDF, Word, Excel, PowerPoint, and images. Retrieve long content in chunks by offset and max characters for processing or inspection.

Instructions

Read what is in a file.

  • Text files (txt, md, csv, json, xml, code, …): the text.

  • PDF, Word (docx/odt), Excel (xlsx/ods) and PowerPoint (pptx/odp): the extracted text (PDF per page, spreadsheets per sheet as tab-separated rows; formatting and images are dropped, spreadsheet dates appear as numbers). Scanned PDFs without a text layer return little or nothing — use nextcloud_get_preview to look at them.

  • Images: the image itself (scaled down).

Long content comes in chunks of 'max_chars'; the result says which 'offset' to request next. Files above 10 MB are not read.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "path": "<path>"
    },
    "name": "nextcloud_read_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesFile path, relative to the user's Nextcloud root, e.g. '/Documents/Offers/offer-4711.pdf'
offsetNoCharacter offset to start from, for reading long content in chunks.
max_charsNoMaximum characters to return in this call.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.2

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnly, idempotent, non-destructive, and closed-world, so the safety profile is covered. Beyond them, the description discloses the important quirks: formatting and images are dropped, spreadsheet dates come back as numbers, images are scaled down, and files over 10 MB are refused. It stops short of describing error behavior or permission requirements.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A one-line purpose statement followed by scannable bullets grouped by file type and then by pagination and size limits. Every line carries information (extraction rules, date formatting, chunking, the 10 MB cap) with no filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, so the description bears the burden of explaining return values, and it does: per-type output shape, per-page PDF text, per-sheet tab-separated rows, scaled images, and the chunk-and-offset continuation contract. Combined with the annotations covering safety and idempotency, an agent has enough to call this correctly without guessing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so path, offset, and max_chars are already documented, making 3 the baseline. The description adds real value by explaining the continuation loop -- content returns in chunks of max_chars and the result reports which offset to request next -- which ties the two pagination parameters into a workflow the schema alone does not convey.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The opening line names a specific verb and resource ("Read what is in a file") and the bullets immediately spell out what content means for text, office documents, and images. It also carves out scope against a named sibling (nextcloud_get_preview for scanned PDFs), so an agent can tell this apart from the preview and download tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives a concrete routing rule -- use nextcloud_get_preview for scanned PDFs without a text layer -- and implicitly frames the tool as the way to get parsed content rather than raw bytes. It does not explicitly contrast with nextcloud_download_file or nextcloud_search_file_contents, so the alternative-selection picture is incomplete but clear for the main case.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.