Skip to main content
Glama

search_drive_files

Search Google Drive and shared drives for files and folders using free text or structured queries. Filter by file type, order results, and paginate.

Instructions

Search Drive (including shared drives) for files and folders.

Free-text queries are auto-wrapped in fullText contains '...'; structured Drive queries pass through as-is. For listing a single folder by parent use list_drive_items. For file content use get_drive_file_content. Requires the drive.readonly OAuth scope.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
user_google_emailYesThe user's Google email address (authenticated account).
queryYesFree text (auto-wrapped) or a Drive query expression like `name contains 'Q3' and mimeType = 'application/pdf' and modifiedTime > '2026-01-01T00:00:00'`. Owner-based queries ("x@y.com in owners") do NOT work inside shared drives — search by modifiedTime and order_by="modifiedTime desc" instead.
page_sizeNoMax files returned, 1-1000. Default 10.
page_tokenNoCursor from a prior response's `nextPageToken`.
drive_idNoShared drive ID to restrict the search. Omit for My Drive + shared-with-me.
include_items_from_all_drivesNoTrue (default) to include shared drive items when drive_id is omitted.
corporaNoScope — "user", "domain", "drive", or "allDrives". Defaults to "drive" when drive_id is set. Prefer "user" or "drive" over "allDrives" for performance.
file_typeNoFriendly alias ("folder", "doc", "sheet", "slides", "form", "drawing", "pdf", "shortcut", "script", "site", "jamboard") or raw MIME type ("application/pdf"). Adds a mimeType filter.
detailedNoTrue (default) includes size, modified time, webViewLink per file; False returns just name/ID/type.
order_byNoComma-separated sort keys: createdTime, folder, modifiedByMeTime, modifiedTime, name, name_natural, quotaBytesUsed, recency, sharedWithMeTime, starred, viewedByMeTime. Append " desc" to reverse. Example: "folder,modifiedTime desc,name".

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed10 schema fields changedv1.0.0
    • changedInput schema / properties / corpora / description
      Previous value: -"Bodies of items to query (e.g., 'user', 'domain', 'drive', 'allDrives').\n                     If 'drive_id' is specified and 'corpora' is None, it defaults to 'drive'.\n                     Otherwise, Drive API default behavior applies. Prefer 'user' or 'drive' over 'allDrives' for efficiency."New value: +"Scope — \"user\", \"domain\", \"drive\", or \"allDrives\".\nDefaults to \"drive\" when drive_id is set. Prefer \"user\" or\n\"drive\" over \"allDrives\" for performance."
    • changedInput schema / properties / detailed / description
      Previous value: -"Whether to include size, modified time, and link in results. Defaults to True."New value: +"True (default) includes size, modified time, webViewLink\nper file; False returns just name/ID/type."
    • changedInput schema / properties / drive_id / description
      Previous value: -"ID of the shared drive to search. If None, behavior depends on `corpora` and `include_items_from_all_drives`."New value: +"Shared drive ID to restrict the search. Omit for My\nDrive + shared-with-me."
    • changedInput schema / properties / file_type / description
      Previous value: -"Restrict results to a specific file type. Accepts a friendly\n                       name ('folder', 'document'/'doc', 'spreadsheet'/'sheet',\n                       'presentation'/'slides', 'form', 'drawing', 'pdf', 'shortcut',\n                       'script', 'site', 'jam'/'jamboard') or any raw MIME type\n                       string (e.g. 'application/pdf'). Defaults to None (all types)."New value: +"Friendly alias (\"folder\", \"doc\", \"sheet\", \"slides\",\n\"form\", \"drawing\", \"pdf\", \"shortcut\", \"script\", \"site\",\n\"jamboard\") or raw MIME type (\"application/pdf\"). Adds a\nmimeType filter."
    • changedInput schema / properties / include_items_from_all_drives / description
      Previous value: -"Whether shared drive items should be included in results. Defaults to True. This is effective when not specifying a `drive_id`."New value: +"True (default) to include shared\ndrive items when drive_id is omitted."
    • changedInput schema / properties / order_by / description
      Previous value: -"Sort order. Comma-separated list of sort keys with optional 'desc' modifier.\n                      Valid keys: 'createdTime', 'folder', 'modifiedByMeTime', 'modifiedTime',\n                      'name', 'name_natural', 'quotaBytesUsed', 'recency', 'sharedWithMeTime',\n                      'starred', 'viewedByMeTime'. Example: 'modifiedTime desc' or 'folder,modifiedTime desc,name'.\n                      Defaults to None (Drive API default ordering)."New value: +"Comma-separated sort keys: createdTime, folder,\nmodifiedByMeTime, modifiedTime, name, name_natural,\nquotaBytesUsed, recency, sharedWithMeTime, starred,\nviewedByMeTime. Append \" desc\" to reverse. Example:\n\"folder,modifiedTime desc,name\"."
    • changedInput schema / properties / page_size / description
      Previous value: -"The maximum number of files to return. Defaults to 10."New value: +"Max files returned, 1-1000. Default 10."
    • changedInput schema / properties / page_token / description
      Previous value: -"Page token from a previous response's nextPageToken to retrieve the next page of results."New value: +"Cursor from a prior response's `nextPageToken`."
    • changedInput schema / properties / query / description
      Previous value: -"The search query string. Supports Google Drive search operators.\n         NOTE: Owner-based queries ('user@example.com' in owners) DO NOT WORK in Shared Drives\n         because files are owned by the shared drive itself, not individual users.\n         For recent files by a specific user in Shared Drives, search by modifiedTime\n         and use order_by='modifiedTime desc' instead."New value: +"Free text (auto-wrapped) or a Drive query expression like\n`name contains 'Q3' and mimeType = 'application/pdf' and\nmodifiedTime > '2026-01-01T00:00:00'`. Owner-based queries\n(\"x@y.com in owners\") do NOT work inside shared drives —\nsearch by modifiedTime and order_by=\"modifiedTime desc\"\ninstead."
    • changedInput schema / properties / user_google_email / description
      Previous value: -"The user's Google email address. Required."New value: +"The user's Google email address (authenticated\naccount)."
  2. First observedv1.19.0

TDQS

A4.6/5.0
Behavior4/5

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

With no annotations, description covers auto-wrapping, query limitations in shared drives (owner-based queries fail), workaround using modifiedTime, and parameter behaviors like pagination and file_type aliases. Implicitly read-only.

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?

Concise yet comprehensive; each sentence adds new information. Structured with purpose, query types, alternatives, and OAuth scope. No redundancy.

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 complexity (10 params, broad use), description covers purpose, differentiation, parameter details, limitations, and OAuth. Output schema handles return values, so completeness is high.

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

Parameters5/5

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

Schema coverage is 100%, but description adds significant value: explains query wrapping, file_type alias resolution, order_by format with examples, corpora performance, and drive_id restriction. Goes well beyond schema.

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?

Clearly states 'Search Drive (including shared drives) for files and folders.' Distinguishes from sibling tools like list_drive_items (for listing a folder by parent) and get_drive_file_content (for file content), providing specific verb and resource.

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?

Explains free-text vs. structured queries and offers alternatives (list_drive_items for parent listing, get_drive_file_content for content). Also mentions required OAuth scope and performance suggestions for corpora. Lacks explicit 'when not to use' but provides sufficient context.

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/HuntsDesk/ve-gws'

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