update_file

Updates file metadata (name, date) by fileId. Wraps the updateFile RPC.

Use with an AI agent

Export this page as Markdown or bundle it with a task for your agent.

Try a task
Preview the prompt that will be copied

Access

  • Effect: Changes data
  • Required scope: write (the mcp scope also grants it)

Example request

The JSON-RPC message an MCP client sends to call this tool. Your client builds it for you; this is for reference and debugging in a tool such as MCP Inspector.

json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "update_file",
    "arguments": {
      "file": {}
    }
  }
}

Example IDs refer to fictional demo data. Replace them with IDs from your account before calling the real server.

Description

Updates file metadata (name, date) by fileId. Wraps the updateFile RPC.

Get fileId from list_files.
If fileId is unknown, pass fileName (current name or hint like "June receipt"); every hint word must match a whole word of the file name, and more than one match returns the candidates to ask about.
If fileFieldMasks is omitted, masks are inferred from the provided file fields.

Input parameters

NameTypeRequiredDescription
fileobjectYes
fileFieldMasksarrayNo
fileIdstringNo
fileNamestringNo
Full input schema (JSON Schema)
json
{
  "additionalProperties": false,
  "properties": {
    "file": {
      "additionalProperties": false,
      "properties": {
        "date": {
          "type": [
            "null",
            "string"
          ]
        },
        "name": {
          "type": [
            "null",
            "string"
          ]
        }
      },
      "type": "object"
    },
    "fileFieldMasks": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "path": {
            "type": "string"
          }
        },
        "required": [
          "path"
        ],
        "type": "object"
      },
      "type": [
        "null",
        "array"
      ]
    },
    "fileId": {
      "type": "string"
    },
    "fileName": {
      "type": [
        "null",
        "string"
      ]
    }
  },
  "required": [
    "file"
  ],
  "type": "object"
}