Skip to main content
Glama

searchFileContents

Search Google Drive files by content or name, and extract matching text snippets from Word documents and PDFs to locate information inside Office files and PDFs.

Instructions

Search Google Drive for files whose content or name matches a query. For .docx and .pdf files, extracts and returns matching text snippets. Use this to find information inside Office documents and PDFs.

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>"
    },
    "name": "searchFileContents"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryYesText to search for
folderIdNoRestrict search to a specific folder ID
maxResultsNoMax number of files to search (default 5)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv4.0.0-rc.1

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations, the description must carry the full behavioral burden; it usefully discloses that matching text snippets are returned for .docx and .pdf. It does not say what happens for other file types (name-only matches?), what permissions or auth are needed, or how large result sets behave.

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?

Three short sentences, front-loaded with the core action and scoped with the file-type detail. The final sentence partially restates the earlier one but still adds a usage cue rather than pure filler.

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

Completeness3/5

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

For a 3-parameter read tool with no annotations and no output schema, the description covers purpose and snippet return but omits file-type limits, permission prerequisites, and result ordering. Enough to call it, not enough to predict its behavior in edge cases.

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 coverage is 100%, so all three parameters are already documented in the schema, setting the baseline at 3. The description adds only that the query matches content or name; it says nothing extra about folderId scoping or how maxResults counts files versus matches.

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?

States a specific verb and resource ('Search Google Drive for files') plus the matching scope ('content or name') and the extraction behavior for .docx and .pdf. It does not name or distinguish itself from the sibling searchDocuments, leaving that differentiation to inference.

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

Usage Guidelines3/5

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

'Use this to find information inside Office documents and PDFs' implies the usage context but gives no explicit when-not conditions or named alternatives. An agent must guess how this differs from searchDocuments or readDriveFile.

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

Deploy Server

Other Tools