Skip to main content
Glama

read_chunk_neighbors

Retrieve chunks immediately before and after a search result to supply surrounding context for a matched document chunk.

Instructions

Read the chunks immediately before and after a search result, for context.

Provide exactly one of filePath (absolute path inside a document root) or source (the id of a data/url item). before/after control how many chunks to include on each side of chunkIndex (both default to 1). A chunk of a PDF carries pages as in query_documents.

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": {
      "chunkIndex": "<chunkIndex>"
    },
    "name": "read_chunk_neighbors"
  }
}

Input Schema

NameRequiredDescriptionDefault
afterNo
beforeNo
sourceNo
filePathNo
chunkIndexYes

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description must carry the full behavioral burden. It discloses the mutual-exclusivity constraint, the default of 1 for before/after, and that PDF chunks carry a `pages` field as in query_documents. It says nothing about behavior at document boundaries (first/last chunk), what happens with an out-of-range chunkIndex, or error conditions.

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

Conciseness4/5

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

Four short sentences with the purpose front-loaded and no filler. The line breaks inside sentences are an artifact of formatting rather than a structural aid, but no sentence is wasted.

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

Completeness4/5

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

An output schema exists, so return-value explanation is unnecessary, and the parameter set is well described for a 5-parameter tool. The one notable gap is provenance of chunkIndex — the agent is told how many neighbors to fetch but not where the reference index comes from.

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 0%, so the description must compensate, and it largely does: filePath is an absolute path inside a document root, source is the id of a data/url item, and before/after are counts on each side of chunkIndex with default 1. chunkIndex itself is only referenced obliquely ('on each side of chunkIndex') and never defined as the index obtained from a search result.

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

Purpose4/5

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

States a specific verb and resource: read the chunks immediately before and after a search result, for context. That is clearly distinct from query_documents and read_file, but the description never explicitly contrasts itself with those siblings, so the agent must infer the selection rule.

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

Usage Guidelines3/5

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

The phrase 'for context' plus 'before and after a search result' implies the tool is a follow-up to a search, and the 'provide exactly one of filePath or source' rule is a real usage constraint. However, there is no explicit when-to-use versus when-not, and no named alternative such as read_file or query_documents is offered for comparison.

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