MCP Tools Reference: drivemcp.googleapis.com

ツール: list_recent_files

このツールを呼び出して、ユーザーの最近のファイルを指定された並べ替え順序で検索します。デフォルトの並べ替え順は recency です。

サポートされている並べ替え順序は次のとおりです。

  • recency: ファイルの日付 / 時刻フィールドの最新のタイムスタンプ。
  • lastModified: 誰かが最後にファイルを変更した日時。
  • lastModifiedByMe: ユーザーが最後にファイルを変更した日時。

デフォルトのページサイズは 10 です。next_page_token を使用して結果をページ分けします。

次のサンプルは、curl を使用して list_recent_files MCP ツールを呼び出す方法を示しています。

Curl リクエスト
curl --location 'https://drivemcp.googleapis.com/mcp/v1' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--header 'content-type: application/json' \
--header 'accept: application/json, text/event-stream' \
--data '{
  "method": "tools/call",
  "params": {
    "name": "list_recent_files",
    "arguments": {
      // provide these details according to the tool's MCP specification
    }
  },
  "jsonrpc": "2.0",
  "id": 1
}'
                

入力スキーマ

ファイルの一覧を取得するリクエスト。

ListFilesRequest

JSON 表現
{

  "orderBy": string

  "pageToken": string

  "pageSize": integer

  "excludeContentSnippets": boolean
}
フィールド

共用体フィールド _order_by

_order_by は次のいずれかになります。

orderBy

string

ファイルの並べ替え順序。

共用体フィールド _page_token

_page_token は次のいずれかになります。

pageToken

string

ページ設定に使用するページトークン。

共用体フィールド _page_size

_page_size は次のいずれかになります。

pageSize

integer

返すファイルの最大数。

共用体フィールド _exclude_content_snippets

_exclude_content_snippets は次のいずれかになります。

excludeContentSnippets

boolean

true の場合、コンテンツ スニペットはレスポンスから除外されます。

出力スキーマ

ファイル一覧のレスポンス。

ListFilesResponse

JSON 表現
{
  "files": [
    {
      object (File)
    }
  ],

  "nextPageToken": string
}
フィールド
files[]

object (File)

ファイルのリスト。

共用体フィールド _next_page_token

_next_page_token は次のいずれかになります。

nextPageToken

string

次のページトークン。

ファイル

JSON 表現
{
  "id": string,
  "title": string,
  "parentId": string,

  "mimeType": string

  "fileSize": string

  "description": string

  "fileExtension": string

  "contentSnippet": string

  "viewUrl": string

  "sharedWithMeTime": string

  "createdTime": string

  "modifiedTime": string

  "viewedByMeTime": string

  "owner": string

  "canAddChildren": boolean
}
フィールド
id

string

取得されたファイルの ID。

title

string

ファイルのタイトル。

parentId

string

(省略可)ファイルの親の ID。

共用体フィールド _mime_type

_mime_type は次のいずれかになります。

mimeType

string

ファイルの MIME タイプ。

共用体フィールド _file_size

_file_size は次のいずれかになります。

fileSize

string (int64 format)

ファイルのサイズ(バイト単位)。

共用体フィールド _description

_description は次のいずれかになります。

description

string

ファイルの説明。

共用体フィールド _file_extension

_file_extension は次のいずれかになります。

fileExtension

string

ファイルの元の拡張子。これは、コンテンツがドライブに保存されているファイルに対してのみ入力されます。

共用体フィールド _content_snippet

_content_snippet は次のいずれかになります。

contentSnippet

string

ファイルの内容に関する生成されたスニペット。

共用体フィールド _view_url

_view_url は次のいずれかになります。

viewUrl

string

ファイルを表示するための URL。

共用体フィールド _shared_with_me_time

_shared_with_me_time は次のいずれかになります。

sharedWithMeTime

string (Timestamp format)

ファイルがリクエスト元と共有された時刻。

RFC 3339 を使用します。生成された出力は常に Z 正規化され、小数点以下は 0、3、6、または 9 桁になります。「Z」以外のオフセットも使用できます。例: "2014-10-02T15:01:23Z""2014-10-02T15:01:23.045123456Z""2014-10-02T15:01:23+05:30"

共用体フィールド _created_time

_created_time は次のいずれかになります。

createdTime

string (Timestamp format)

ファイルが作成された日時。

RFC 3339 を使用します。生成された出力は常に Z 正規化され、小数点以下は 0、3、6、または 9 桁になります。「Z」以外のオフセットも使用できます。例: "2014-10-02T15:01:23Z""2014-10-02T15:01:23.045123456Z""2014-10-02T15:01:23+05:30"

共用体フィールド _modified_time

_modified_time は次のいずれかになります。

modifiedTime

string (Timestamp format)

ファイルが最後に変更された時刻。

RFC 3339 を使用します。生成された出力は常に Z 正規化され、小数点以下は 0、3、6、または 9 桁になります。「Z」以外のオフセットも使用できます。例: "2014-10-02T15:01:23Z""2014-10-02T15:01:23.045123456Z""2014-10-02T15:01:23+05:30"

共用体フィールド _viewed_by_me_time

_viewed_by_me_time は次のいずれかになります。

viewedByMeTime

string (Timestamp format)

リクエスト元がファイルを最後に閲覧した日時。

RFC 3339 を使用します。生成された出力は常に Z 正規化され、小数点以下は 0、3、6、または 9 桁になります。「Z」以外のオフセットも使用できます。例: "2014-10-02T15:01:23Z""2014-10-02T15:01:23.045123456Z""2014-10-02T15:01:23+05:30"

共用体フィールド _owner

_owner は次のいずれかになります。

owner

string

ファイルのオーナーのメールアドレス。

共用体フィールド _can_add_children

_can_add_children は次のいずれかになります。

canAddChildren

boolean

リクエスト元がこのフォルダに子フォルダを追加できるかどうか。フォルダ以外のタイプの場合、これは常に false です。

タイムスタンプ

JSON 表現
{
  "seconds": string,
  "nanos": integer
}
フィールド
seconds

string (int64 format)

UNIX エポック 1970-01-01T00:00:00Z からの UTC 時刻の秒数を表します。-62135596800~253402300799 の範囲(両端を含む)にする必要があります(これは 0001-01-01T00:00:00Z~9999-12-31T23:59:59Z に対応します)。

nanos

integer

ナノ秒分解能による、秒の負ではない小数以下部分。このフィールドは、秒の代替ではなく、期間のナノ秒部分です。小数以下を含む負の秒の値は、時間を前方にカウントする負ではない nanos 値を持つ必要があります。0~999,999,999 にする必要があります(両端を含む)。

ツールのアノテーション

破壊的ヒント: ❌ | べき等ヒント: ✅ | 読み取り専用ヒント: ✅ | オープン ワールド ヒント: ❌

認可スコープ

次の OAuth スコープのいずれかが必要です。

  • https://www.googleapis.com/auth/drive
  • https://www.googleapis.com/auth/drive.appdata
  • https://www.googleapis.com/auth/drive.file
  • https://www.googleapis.com/auth/drive.meet.readonly
  • https://www.googleapis.com/auth/drive.metadata
  • https://www.googleapis.com/auth/drive.metadata.readonly
  • https://www.googleapis.com/auth/drive.photos.readonly
  • https://www.googleapis.com/auth/drive.readonly