Skip to main content
Glama
vgnshiyer

apple-books-mcp

by vgnshiyer

Get the passage around a highlight

get_annotation_context
Read-only

Retrieve the text surrounding a saved highlight to expand on a passage without fetching the whole chapter. Set how many characters of context to include before and after.

Instructions

Return the passage around a specific highlight — the text before and after, with the highlight itself wrapped in «...». Use this to expand on a highlight without fetching the whole chapter.

Works for non-DRM EPUBs downloaded to this Mac; fails with a clear message for DRM-protected books, iCloud-only books, or older annotations that lack the chapter hint.

Args: annotation_id: The annotation's numeric ID. chars_before: Chars of context before the highlight (0–5000). Default 500. chars_after: Chars of context after the highlight (0–5000). Default 500.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chars_afterNo
chars_beforeNo
annotation_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.8.4

TDQS

A4.5/5.0
Behavior4/5

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

Annotations only cover readOnlyHint and openWorldHint. The description adds substantial behavioral context beyond that: the «...» output formatting convention and explicit failure modes (DRM-protected, iCloud-only, or older annotations lacking the chapter hint) with promises of a clear error message.

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?

The core purpose and limitation notes are front-loaded and earn their place; the Args block is warranted given 0% schema coverage. Slightly verbose in formatting but no wasted sentences.

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?

With no output schema, the description correctly explains the return format (surrounding text with the highlight marked) plus failure modes. For a 3-param read tool with annotations covering safety, nothing essential is missing.

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

Parameters5/5

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

Schema coverage is 0%, so the description bears full burden, and it delivers: annotation_id is identified as the numeric ID, and both chars_before and chars_after are documented with bounds (0–5000) and a default of 500. This fully compensates for the schema gap.

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?

States a specific verb and resource ('Return the passage around a specific highlight') and clarifies the scope (text before/after with the highlight wrapped in «...»). This clearly distinguishes it from siblings like describe_annotation or get_chapter_content, which fetch metadata or full chapters.

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?

Provides explicit usage context: 'Use this to expand on a highlight without fetching the whole chapter.' This tells the agent when to prefer this over a heavier fetch, though it does not name a specific sibling alternative.

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