Skip to main content
Glama

read_document

Read-onlyIdempotent

Read a document's text within a selected block range, returning citation-anchored content and structured blocks for accurate summarization and source-grounding verification.

Instructions

문서 본문을 인용 앵커를 붙여 범위 지정으로 읽습니다.

형식이 달라도 인터페이스는 하나입니다. 모든 형식을 블록의 1차원 목록으로 평탄화하므로 start/end만 쓰면 됩니다. 블록 하나가 무엇인지는 응답의 unit이 알려 줍니다 (pdf=페이지, pptx=슬라이드 줄, docx=문단·표행).

등급이 C면 텍스트가 없다는 뜻입니다. 그때는 read_document_image로 넘어가세요 — 이 도구가 빈 본문을 돌려주는 것을 "내용이 없다"로 읽으면 안 됩니다.

요약할 때 앵커를 그대로 인용하세요. Phase 4의 check_summary_grounding이 그 앵커로 원문 대조를 합니다. 앵커 없는 문장은 근거 없는 문장으로 처리됩니다.

Args: path: 읽을 파일. start: 시작 블록 번호(1부터). end: 끝 블록 번호(포함). 생략하면 글자 수 상한까지.

Returns: ReadDocumentResponse: 확정 등급, 앵커 붙은 본문, 구조화 블록, 형식별 메타.

Examples: - 사용: "이 PDF 3~8페이지에 뭐가 있나요?" → start=3, end=8 - 사용하지 않음: 페이지 수·제목 구조만 필요할 때 → inspect_document - 사용하지 않음: 등급 C 파일 → read_document_image

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endNo읽기를 끝낼 블록 번호(포함). None이면 글자 수 상한까지 읽습니다. 블록의 뜻은 응답의 unit 필드가 알려 줍니다
pathYesscan_folder가 돌려준 상대 경로, 또는 root 안의 절대 경로
startNo읽기 시작할 블록 번호(1부터)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
endYes이 응답이 담은 마지막 블록 번호
metaYes형식별 메타 (페이지 수, 표 개수 등)
pathYes
unitYes이 형식에서 블록 하나가 무엇인지 (페이지/슬라이드/문단)
gradeYes확정된 추출가능등급. A=구조까지, B=본문만, C=텍스트 없음
stageYes분석 워크플로에서 지금 위치한 단계
startYes이 응답이 담은 첫 블록 번호 (1부터)
blocksYes같은 내용의 구조화 형태
statusYes이 호출의 결과 상태
contentYes앵커가 붙은 본문. 'p3 | 내용' 형태로 한 줄씩 이어집니다
unit_countYes원래 단위의 개수 (총 페이지 수 등)
grade_reasonYes그 등급으로 판정한 근거
next_actionsNo이어서 호출하면 좋은 도구 목록
total_blocksYes문서 전체의 블록 수
truncated_by_charsYesTrue면 글자 수 상한 때문에 범위 안에서도 잘렸습니다
Behavior5/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint, so the safety profile is covered. The description adds rich behavioral context: the unified interface flattening all formats to a 1D block list, the 'unit' field clarifying block semantics per format, the grade C null-text signal and how to interpret it, and the anchor-citation contract for grounding. No contradictions with annotations.

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?

The description is front-loaded with the core purpose and key behavior (anchors + range), uses bold labels and bullet-style separators for readability, and includes examples without padding. Every sentence earns its place—no fluff or repetition of schema fields.

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?

Given an output schema exists (ReadDocumentResponse), the description doesn't need to detail return structure—it summarizes the key fields. It covers edge cases (grade C), cross-tool interactions (inspect_document, read_document_image, check_summary_grounding), and parameter semantics. For a tool with 3 params and rich sibling relationships, this is fully complete for correct invocation.

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% and each parameter has a description, so the baseline is 3. The description adds practical meaning beyond the schema: it explains the block concept (via 'unit'), gives a concrete example mapping 'PDF 3~8 pages' to start=3,end=8, and clarifies that end omitted reads to a character limit. This elevates it above the baseline.

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 description states a specific verb (read) and resource (document body) with a key qualifier (citation anchors), and explicitly distinguishes itself from siblings: 'inspect_document' for metadata-only needs and 'read_document_image' for grade C files. An agent can immediately tell what this tool does and why it exists.

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

Usage Guidelines5/5

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

The description gives explicit 'when to use' (reading content with anchors), 'when not to use' (inspect_document for page count/title, read_document_image for grade C), and even explains the downstream dependency on check_summary_grounding that requires anchors. This leaves zero ambiguity about selection conditions.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/goods9999-ai/personal-file-analysis-mcp_test_20260826'

If you have feedback or need assistance with the MCP directory API, please join our Discord server