Skip to main content
Glama
pdf2mcp

pdf2mcp

by iSamBa

search_in_doc

Search a single PDF for relevant passages and return ranked results with section titles and page numbers. Use a known filename to avoid noise from other documents.

Instructions

Search within a SINGLE document for relevant passages.

Use this when you already know which PDF to search — avoids noise from
other documents. Returns ranked results with section title and page numbers.

Get valid filenames from list_docs first.

Args:
    query: Natural language search query (e.g., 'maximum torque settings').
    filename: The PDF filename to search within (e.g., 'manual.pdf').
    num_results: Number of results to return (default: 5, max: 20).

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": {
      "query": "<query>",
      "filename": "<filename>"
    },
    "name": "search_in_doc"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryYes
filenameYes
num_resultsNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.0

TDQS

A4.1/5.0
Behavior3/5

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

With no annotations supplied, the description must carry the behavioral load; it discloses the return shape (ranked results with section title and page numbers) and the prerequisite of valid filenames. It never states read-only semantics or what happens for an invalid/unknown filename, which matters for a tool with zero annotation coverage. The output schema reduces the need to spell out return values further.

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?

Front-loads purpose, then when-to-use, then return format, then prerequisite, then args — a sensible ordering with little waste. The Args block is slightly redundant with the schema's parameter titles but is justified given the 0% schema description coverage.

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?

For a simple three-parameter read tool, the description covers purpose, selection condition, prerequisite, and parameter meanings, and an output schema exists so return values need no further explanation. The only meaningful gap is the absence of any statement about failure behavior or read-only guarantees.

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 the description must compensate, and it documents all three parameters: query as a natural-language string with an example, filename with an example, and num_results with a default of 5 and a max of 20 (the max is not present in the schema). The examples are somewhat generic, which keeps it below a 5, but the coverage gap is otherwise filled.

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 (search) with an explicit scope constraint (a SINGLE document) and immediately contrasts that scope with searching across documents ('avoids noise from other documents'). An agent can distinguish this from search_docs purely from the description.

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?

'Use this when you already know which PDF to search' gives a clear selection condition, and 'Get valid filenames from list_docs first' names the required prerequisite tool. It stops short of an explicit when-not statement naming search_docs, so it is strong but not complete routing guidance.

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