Power Gws Invoker
Boost productivity using this read, write, google, forms. Includes structured workflows, validation checks, and reusable patterns for google workspace.
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
| Aspect | Details |
|---|---|
| Services | Directory, Drive, Gmail, Calendar, Chat, Reports, Groups, Licensing |
| Authentication | Automatic OAuth2 token management with scope validation |
| Methods | Maps to REST API methods like users.list, files.get, messages.send |
| Parameters | JSON parameter passing with automatic type conversion |
| Pagination | Automatic 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
| Parameter | Type | Default | Description |
|---|---|---|---|
| service | string | (required) | Target API service: directory, drive, gmail, calendar |
| method | string | (required) | API method in resource.action format |
| params | string | (none) | JSON string of API parameters |
| output | string | table | Response format: table, json, raw |
| page-token | string | (none) | Pagination token for fetching next page of results |
Best Practices
-
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.
-
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.
-
Use JSON output for scripting - When piping results to other tools or scripts, use
--output jsonfor machine-parseable output instead of the default table format. -
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.
-
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
-
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.
-
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. -
Parameter type mismatch - Numeric and boolean parameters must be the correct type in JSON. Use
"maxResults": 10not"maxResults": "10"to avoid API validation errors.
Reviews
No reviews yet. Be the first to review this template!
Similar Templates
Git Commit Message Generator
Generates well-structured conventional commit messages by analyzing staged changes. Follows Conventional Commits spec with scope detection.
React Component Scaffolder
Scaffolds a complete React component with TypeScript types, Tailwind styles, Storybook stories, and unit tests. Follows project conventions automatically.
CI/CD Pipeline Generator
Generates GitHub Actions workflows for CI/CD including linting, testing, building, and deploying. Detects project stack automatically.