Skip to main content
Glama

readwise_search_highlights

Search across all highlights using text queries and field-specific filters to find specific content in your Readwise library.

Instructions

Advanced search across all highlights using text queries and field-specific filters. Equivalent to official Readwise MCP search functionality.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textQueryNoMain text to search for across all highlight content (like vector_search_term)
fieldQueriesNoSpecific field searches (like full_text_queries)
bookIdNoFilter results to specific book
limitNoMaximum number of results to return

Implementation Reference

  • The core handler function that executes the tool logic: initializes the Readwise client, maps arguments to search parameters, calls client.searchHighlights(), processes results, and returns formatted JSON.
    export async function handleSearchHighlights(args: any) {
      const client = await initializeClient();
      
      const params = {
        textQuery: args.textQuery,
        fieldQueries: args.fieldQueries,
        bookId: args.bookId,
        limit: args.limit,
      };
      
      const response = await client.searchHighlights(params);
      
      // Strip to essentials
      const minimal = response.data.map(result => ({
        text: result.highlight.text,
        note: result.highlight.note || undefined,
        book: result.book.title,
        author: result.book.author,
        score: result.score
      }));
      
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(minimal, null, 2),
          },
        ],
      };
    }
  • Tool definition including name, description, and input schema for parameter validation.
    {
      name: 'readwise_search_highlights',
      description: 'Advanced search across all highlights using text queries and field-specific filters. Equivalent to official Readwise MCP search functionality.',
      inputSchema: {
        type: 'object',
        properties: {
          textQuery: {
            type: 'string',
            description: 'Main text to search for across all highlight content (like vector_search_term)',
          },
          fieldQueries: {
            type: 'array',
            items: {
              type: 'object',
              properties: {
                field: {
                  type: 'string',
                  enum: ['document_title', 'document_author', 'highlight_text', 'highlight_note', 'highlight_tags'],
                  description: 'Field to search in',
                },
                searchTerm: {
                  type: 'string',
                  description: 'Term to search for in the specified field',
                },
              },
              required: ['field', 'searchTerm'],
            },
            description: 'Specific field searches (like full_text_queries)',
          },
          bookId: {
            type: 'number',
            description: 'Filter results to specific book',
          },
          limit: {
            type: 'number',
            description: 'Maximum number of results to return',
          },
        },
        additionalProperties: false,
      },
    },
  • Dispatches calls to the 'readwise_search_highlights' tool to the appropriate handler function via switch case.
    case 'readwise_search_highlights':
      return handleSearchHighlights(args);
  • src/index.ts:24-26 (registration)
    Registers the full tools list (including readwise_search_highlights schema) for MCP ListTools requests.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return { tools };
    });
  • src/index.ts:28-33 (registration)
    Sets up the MCP CallTool handler that routes to handleToolCall based on tool name.
    server.setRequestHandler(CallToolRequestSchema, async (request) => {
      const { name, arguments: args } = request.params;
    
      try {
        return await handleToolCall(name, args);
      } catch (error) {
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It describes the tool as an 'advanced search' but doesn't mention whether this is a read-only operation, potential rate limits, authentication needs, or what the output format looks like. For a search tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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 description is concise with two sentences that efficiently convey the core functionality and equivalence. It's front-loaded with the main purpose and avoids unnecessary details, though the second sentence about equivalence could be more directly helpful for tool selection.

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

Completeness2/5

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

Given no annotations and no output schema, the description is incomplete for an advanced search tool. It doesn't explain what the search returns (e.g., highlight objects, metadata), how results are ordered, or any limitations. For a tool with 4 parameters and complex filtering capabilities, more context is needed to use it effectively.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents all four parameters thoroughly. The description adds minimal value beyond the schema by mentioning 'text queries and field-specific filters,' which aligns with the parameters but doesn't provide additional syntax or usage details. Baseline 3 is appropriate when the schema does the heavy lifting.

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?

The description clearly states the tool performs 'Advanced search across all highlights using text queries and field-specific filters,' which is a specific verb+resource combination. It distinguishes this as an 'advanced search' tool but doesn't explicitly differentiate it from sibling tools like 'readwise_topic_search' or 'readwise_list_highlights' beyond mentioning it's equivalent to official Readwise MCP search functionality.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like 'readwise_topic_search' or 'readwise_list_highlights.' It mentions it's 'equivalent to official Readwise MCP search functionality,' but this doesn't help an agent decide between available search-related tools in this server.

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/arnaldo-delisio/readwise-mcp-enhanced'

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