Skip to main content
Glama

drive.files.modifyLabels

Add, update, or remove labels and label fields on a Google Drive file by file ID, returning the labels that were added or modified.

Instructions

Modifies the set of labels applied to a file. For more information, see Set a label field on a file. Returns a list of the labels that were added or modified [HTTP POST] — creates or triggers a change; refused under --readonly safety profiles. Returns the API's response resource as JSON — request body is a JSON ModifyLabelsRequest object accepting kind, labelModifications; pass it via params or whole via body_file Siblings over the same resource: copy, create, delete, download, emptyTrash, export, generateCseToken, generateIds, get, list, listLabels, update, watch.

Input Schema

NameRequiredDescriptionDefault
queryNoExtra KEY=VALUE query pairs for endpoints whose parameters Discovery does not describe.
fileIdYes[URL path segment] The ID of the file to which the labels belong.
paramsNoParameter map merged into the request; typed parameters win.
dry_runNoReturn the request that would be sent, without sending it.
body_fileNoRead the request body from this file ('-' for stdin) instead of building one from the parameters. The body is a JSON ModifyLabelsRequest object.
request_bodyNoRequest body of type ModifyLabelsRequest: pass it via `params` (merged into the built body) or whole via `body_file`.

Output Schema

NameRequiredDescriptionDefault
kindNo
modifiedLabelsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / body_file / description
      Previous value: -"Read the request body from this file ('-' for stdin) instead of building one from the parameters."New value: +"Read the request body from this file ('-' for stdin) instead of building one from the parameters. The body is a JSON ModifyLabelsRequest object."
    • addedInput schema / properties / request_body
      Added value: +{
      +  "description": "Request body of type ModifyLabelsRequest: pass it via `params` (merged into the built body) or whole via `body_file`.",
      +  "properties": {
      +    "kind": {
      +      "type": "string"
      +    },
      +    "labelModifications": {
      +      "items": {
      +        "properties": {
      +          "fieldModifications": {
      +            "items": {
      +              "properties": {
      +                "fieldId": {
      +                  "type": "string"
      +                },
      +                "kind": {
      +                  "type": "string"
      +                },
      +                "setDateValues": {
      +                  "items": {
      +                    "type": "string"
      +                  },
      +                  "type": "array"
      +                },
      +                "setIntegerValues": {
      +                  "items": {
      +                    "type": "string"
      +                  },
      +                  "type": "array"
      +                },
      +                "setSelectionValues": {
      +                  "items": {
      +                    "type": "string"
      +                  },
      +                  "type": "array"
      +                },
      +                "setTextValues": {
      +                  "items": {
      +                    "type": "string"
      +                  },
      +                  "type": "array"
      +                },
      +                "setUserValues": {
      +                  "items": {
      +                    "type": "string"
      +                  },
      +                  "type": "array"
      +                },
      +                "unsetValues": {
      +                  "type": "boolean"
      +                }
      +              },
      +              "type": "object"
      +            },
      +            "type": "array"
      +          },
      +          "kind": {
      +            "type": "string"
      +          },
      +          "labelId": {
      +            "type": "string"
      +          },
      +          "removeLabel": {
      +            "type": "boolean"
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "type": "object"
      +}
  2. Changed2 schema fields changed
    • changedInput schema / properties / fileId / description
      Previous value: -"The ID of the file to which the labels belong."New value: +"[URL path segment] The ID of the file to which the labels belong."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "kind": {
      +      "type": "string"
      +    },
      +    "modifiedLabels": {
      +      "items": {
      +        "properties": {
      +          "fields": {
      +            "type": "object"
      +          },
      +          "id": {
      +            "type": "string"
      +          },
      +          "kind": {
      +            "type": "string"
      +          },
      +          "revisionId": {
      +            "type": "string"
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "type": "object"
      +}
  3. First observed

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations, the description carries the full behavioral burden; it clearly discloses that this is an HTTP POST mutation that creates/triggers a change and is refused under --readonly safety profiles. It does not cover permission requirements, reversibility, or exactly what happens to existing labels not mentioned in the request.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose is front-loaded and the description is not bloated overall, but it repeats return behavior with both 'Returns a list...' and 'Returns the API's response resource...' and appends a long sibling enumeration. Those repetitions reduce conciseness.

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

Completeness4/5

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

For a mutation tool with no annotations and a nested request body, it supplies the key context an agent needs: mutation/safety behavior, body shape, and parameter routing. Since an output schema exists, return values need not be fully explained; missing auth and reversibility details keep it from being complete at the highest level.

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 the baseline is 3. The description mentions ModifyLabelsRequest, kind, labelModifications, and the params/body_file routes, but this largely repeats what the schema already documents rather than adding deeper parameter semantics.

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: modifies the set of labels applied to a file. It also explicitly lists same-resource siblings, making it clearly distinguishable from listLabels, update, and other drive.files operations.

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?

Provides useful context such as the --readonly refusal and a link to label-field guidance, but does not explicitly say when to use this instead of drive.files.update, listLabels, or other label-related operations. The sibling list names alternatives without giving selection criteria.

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