Skip to main content
Glama

search_document_content

Read-onlyIdempotent

Search a document for specific text and return matching lines with line numbers and surrounding context to locate information or prepare edits.

Instructions

    Searches within a document for lines containing a
    text snippet (grep-style), returning matches with
    line numbers and surrounding context.

    Use this tool when you need to:
    - Locate specific text in a large document without
      reading it in full
    - Find the exact text and line number to build
      edit_document old_string values or
      read_document offsets

    Matching is case-insensitive per line. Line numbers
    are 0-based and valid as read_document offsets.

    Args:
        document_id: The document ID to search
        query: Text snippet to find (case-insensitive)
        context_lines: Lines of context around each
            match (default: 2, must be non-negative)

    Returns:
        Matching lines with line numbers and context
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
document_idYes
queryYes
context_linesNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

Annotations already indicate readOnlyHint and idempotentHint. The description adds valuable behavioral details: case-insensitive matching, 0-based line numbers, and context_lines default/constraint. This goes beyond annotations without contradiction.

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 well-structured: purpose sentence, bullet list for usage, behavioral details, parameter list. Every sentence adds value, and the most important information is front-loaded. No unnecessary words.

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 the tool's simplicity (3 params, no nested objects) and presence of an output schema, the description covers all essential aspects: purpose, usage, matching behavior, return format. It is fully sufficient for an agent to invoke correctly.

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 description coverage is 0%, so description carries full burden. It explains all three parameters: document_id, query, context_lines (with default and constraint). It does not specify query format (exact vs regex) but provides sufficient meaning for typical use.

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 clearly states it searches within a document for text (grep-style), returns matches with line numbers and context. It distinguishes from siblings like read_document (full read) and edit_document (edit) by explicitly referencing them as use cases for building arguments.

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?

The description provides explicit when-to-use scenarios: locate specific text without reading full document, and find line numbers to build edit_document old_string or read_document offsets. It does not state when not to use, but the context is clear enough for an agent to decide.

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/Vortiago/mcp-outline'

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