Skip to main content
Glama

mediawiki_search_in_file

Read-only

Search within wiki-hosted PDFs and text files for specific text, returning matches with page or line numbers.

Instructions

Search for text within wiki-hosted files (PDFs, text files).

USE WHEN: User asks "search the PDF for X", "find X in the uploaded document".

NOT FOR: Searching wiki pages (use mediawiki_search or mediawiki_search_in_page).

PARAMETERS:

  • filename: File name on wiki (required)

  • query: Text to search for (required)

RETURNS: Matches with page numbers (for PDFs) or line numbers.

NOTE: Supports text-based PDFs and text files (TXT, MD, CSV, JSON, XML, HTML). Scanned/image PDFs require OCR and are not supported.

Input Schema

NameRequiredDescriptionDefault
queryYesText to search for in the file
filenameYesFile page name (e.g., 'File:Report.pdf' or just 'Report.pdf')
rationaleNoOptional one-sentence explanation of why you are calling this tool. Used for audit trails when present.

Output Schema

NameRequiredDescriptionDefault
matchesYes
messageNo
filenameYes
file_typeYes
searchableYes
match_countYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.31.0
    • addedInput schema / properties / rationale
      Added value: +{
      +  "description": "Optional one-sentence explanation of why you are calling this tool. Used for audit trails when present.",
      +  "type": "string"
      +}
  2. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true, so the safety profile is covered. The description adds genuine context beyond them: which file formats are supported and that scanned/image PDFs require OCR and are unsupported, which is a real capability limit an agent must know before promising a result. It does not explain the idempotentHint=false annotation, which is the one remaining unexplained behavioral trait.

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?

Front-loaded purpose sentence, then labeled USE WHEN / NOT FOR / RETURNS / NOTE blocks that an agent can scan selectively. Every sentence carries distinct information; no repetition of the schema fields beyond a one-line list.

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?

An output schema exists, so the RETURNS line (page numbers for PDFs, line numbers otherwise) is a bonus rather than a necessity, and the format limitations plus the two hard exclusions cover what an agent needs to call this correctly. No prerequisites or auth requirements are omitted that would block a correct invocation.

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 both required parameters and the optional rationale are already documented in the schema, including the 'File:Report.pdf' vs 'Report.pdf' filename format. The description's brief repetition of filename/query adds no syntax or format detail beyond that, so the baseline 3 applies.

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 ('search for text within wiki-hosted files') and immediately scopes it to files rather than pages. The FORMATS NOTE reinforces the resource boundary (PDFs, TXT, MD, CSV, JSON, XML, HTML). An agent can distinguish it from mediawiki_search and mediawiki_search_in_page without opening any schema.

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

Usage Guidelines5/5

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

Explicit USE WHEN with quoted user phrasings ('search the PDF for X') and an explicit NOT FOR clause that names the two alternatives to use instead. Nothing is left to inference about routing between the three search tools.

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