P

Power Gws Invoker

Boost productivity using this read, write, google, forms. Includes structured workflows, validation checks, and reusable patterns for google workspace.

CommandClipticsgoogle workspacev1.0.0MIT
0 views0 copies

Power GWS Invoker

Execute arbitrary Google Workspace API calls with authentication handling and response formatting.

When to Use This Command

Run this command when you need to:

  • Call Google Workspace APIs directly when no dedicated command template covers your use case
  • Test and prototype API requests before integrating them into your application code
  • Execute advanced or undocumented API endpoints that specialized commands do not expose

Consider alternatives when:

  • A dedicated GWS command template exists for your specific service like Drive, Calendar, or Gmail
  • You need to make high-volume API calls that require proper rate limiting and retry logic

Quick Start

Configuration

name: power-gws-invoker type: command category: google-workspace

Example Invocation

claude command:run power-gws-invoker --service directory --method users.list --params '{"domain":"example.com","maxResults":10}'

Example Output

Invoking Google Workspace API...
  Service: Admin Directory
  Method: users.list
  Params: domain=example.com, maxResults=10

Response (200 OK):
  Users found: 10 of 156 total

  Email                      Name              Status    Last Login
  [email protected]          Admin User        ACTIVE    Mar 15
  [email protected]          Alice Johnson     ACTIVE    Mar 15
  [email protected]            Bob Smith         ACTIVE    Mar 14
  [email protected]          Carol Davis       ACTIVE    Mar 14
  ...6 more users

  Next page token: eyJhbG... (use --page-token to continue)

Core Concepts

API Invocation Overview

AspectDetails
ServicesDirectory, Drive, Gmail, Calendar, Chat, Reports, Groups, Licensing
AuthenticationAutomatic OAuth2 token management with scope validation
MethodsMaps to REST API methods like users.list, files.get, messages.send
ParametersJSON parameter passing with automatic type conversion
PaginationAutomatic page token management for multi-page result sets

Invocation Workflow

Specify Service + Method
         |
         v
Validate Required Scopes
         |
         v
Authenticate (OAuth2)
         |
         v
Build API Request
  (method + params)
         |
         v
Execute Request
         |
         v
Format Response
  |           |
  v           v
Table View  Raw JSON

Configuration

ParameterTypeDefaultDescription
servicestring(required)Target API service: directory, drive, gmail, calendar
methodstring(required)API method in resource.action format
paramsstring(none)JSON string of API parameters
outputstringtableResponse format: table, json, raw
page-tokenstring(none)Pagination token for fetching next page of results

Best Practices

  1. Check the API reference first - Before invoking raw API calls, verify the exact method name, required parameters, and expected response format in the Google API documentation.

  2. Start with read-only methods - When exploring an unfamiliar API, begin with list and get methods to understand the data structure before attempting create, update, or delete operations.

  3. Use JSON output for scripting - When piping results to other tools or scripts, use --output json for machine-parseable output instead of the default table format.

  4. Handle pagination for complete data - Many list methods return paginated results. Always check for a next page token and continue fetching until all pages are retrieved.

  5. Test in a sandbox domain - Execute write operations against a test domain or sandbox project first to avoid unintended modifications to production Workspace data.

Common Issues

  1. Method not found error - API method names are case-sensitive and follow the resource.action pattern. Check spelling and verify the method exists for your target service version.

  2. Insufficient scopes - The invoker validates required OAuth scopes before executing. If a scope is missing, run gws auth login --scopes <scope> to add it to your credential.

  3. Parameter type mismatch - Numeric and boolean parameters must be the correct type in JSON. Use "maxResults": 10 not "maxResults": "10" to avoid API validation errors.

Community

Reviews

Write a review

No reviews yet. Be the first to review this template!

Similar Templates