API workflows
The normal gum workflow is search, describe, then invoke. That keeps a caller from guessing operation names, request fields, OAuth scopes, or risk class.
If you are starting from a Google product instead of a task, use Operations by service first. Those pages are generated from the same catalog as gum search.
Find an operation
Start with task words:
gum search "drive files modified recently" --format json
gum search "gmail create draft"
gum search "search console inspect url"Search returns catalog operations. Pick the operation whose service, title, and summary match the task. For wrappers and agents, store the exact op_id after the search step; do not pass natural language into an invocation command.
Inspect the contract
Describe the operation before you call it:
gum describe drive.files.listThe description shows variants, required arguments, OAuth scopes, auth strategy, output profile, and risk class. Treat the selected variant's risk class as authoritative.
Build the request
Use JSON for structured arguments:
gum read drive.files.list \
--args '{"pageSize":10,"fields":"files(id,name,mimeType),nextPageToken"}' \
--output jsonUse fields when the upstream REST method supports partial response. Google then omits the unused fields before gum receives the payload.
Match the risk class
Read operations use gum read:
gum read calendar.events.list \
--args '{"calendarId":"primary","maxResults":5}' \
--output jsonWrite operations require the write command and an explicit write flag:
gum write sheets.spreadsheets.values.update \
--allow-write \
--args '{"spreadsheetId":"<id>","range":"Sheet1!A1","valueInputOption":"RAW"}'Destructive operations use a two-step confirmation flow. Run the command once to receive the confirmation envelope, review the operation and target, then retry with --confirmed --token <confirmation_token>.
gum destructive <op_id> --args '<json>'
gum destructive <op_id> --args '<json>' --confirmed --token '<confirmation_token>'Keep responses small
Large Google responses can burn an agent context window quickly. Keep list and get calls narrow unless the task needs full records.
gum read gmail.users.messages.list \
--args '{"userId":"me","maxResults":10,"fields":"messages(id,threadId),nextPageToken"}' \
--output jsonSee Field masks and Output shaping for response control.
Use the same flow over MCP
MCP clients use the same sequence:
gum.search_apis -> gum.describe_op -> gum.read / gum.write / gum.destructiveConvenience tools exist for common Gmail, Drive, Calendar, Docs, Sheets, Slides, Tasks, and Flights paths. Long-tail access should still go through search and describe first.
Troubleshooting
OP_NOT_FOUNDmeans the operation ID is not in the resolved catalog for theRISK_TOOL_MISMATCHmeans the selected variant belongs to a different riskAUTH_REQUIREDmeans no usable credential was found for the operation.SCOPE_MISSINGmeans the credential exists but does not cover one or more- Google API errors such as
accessNotConfiguredandinsufficientPermissions
active profile.
class than the command or MCP tool you used.
required OAuth scopes.
come from the upstream project or account setup.
