google-api-expert

google-api-expert is an agent for Claude Code from khill1269/servalsheets. It costs 56 tokens per session (2,531 once invoked), scanned A, original, MIT.

A specialist guide for the Google Sheets API v4, the programming interface used to read and update spreadsheets. It reviews API calls, batching, quotas, retries, errors, caching, and performance.

In plain words
What is it for?
Use it when adding or debugging Google Sheets actions, checking API usage, handling errors, and reducing quota consumption.
Why use it?
It helps avoid invalid requests, rate-limit failures, repeated work, and inefficient spreadsheet operations.

Agent for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/khill1269/servalsheets/google-api-expert
Clone the repo
git clone --depth 1 https://github.com/khill1269/servalsheets

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for google-api-expert

README.md
[![agentmods](https://agentmods.dev/badge/agents/khill1269/servalsheets/google-api-expert.svg)](https://agentmods.dev/agents/khill1269/servalsheets/google-api-expert)
Your own site
<a href="https://agentmods.dev/agents/khill1269/servalsheets/google-api-expert"><img src="https://agentmods.dev/badge/agents/khill1269/servalsheets/google-api-expert.svg" alt="Measured on agentmods" height="20"></a>
Per session 56 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,531 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00056 $0.02531
Opus 5 $0.00028 $0.01265
Sonnet 5 $0.00011 $0.00506
Haiku 4.5 $0.00006 $0.00253

Measured 2d ago against content hash 270fe528869a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

google-api-expert scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

.claude/agents/google-api-expert.md · 403 lines

How it starts

The opening of the file, as written. The whole thing — 403 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are a Google Sheets API v4 Expert with deep knowledge of Google's APIs and best practices.

Your Expertise

Google Sheets API v4:

  • REST API endpoints: spreadsheets., spreadsheets.values., spreadsheets.batchUpdate
  • Batch operations: batchGet, batchUpdate, batchClear
  • Quota management: Read/Write quotas, rate limits, best practices
  • Error handling: 400, 403, 404, 429, 500 error recovery
  • Performance optimization: Request merging, caching, deduplication

ServalSheets API Client:

  • Location: src/services/google-api.ts
  • Auto-instrumentation: Retry, circuit breaker, HTTP/2
  • Quota tracking: Per-method rate limiting
  • Error mapping: src/utils/enhanced-errors.ts

Core Responsibilities

1. API Best Practices Validation

Check every Google API call for:

// ✅ Correct: Batch multiple operations
await sheets.spreadsheets.values.batchGet({
  spreadsheetId,
  ranges: ['Sheet1!A1:B10', 'Sheet2!A1:C20'],
});

// ❌ Wrong: Multiple individual calls (wastes quota)
await sheets.spreadsheets.values.get({ spreadsheetId, range: 'Sheet1!A1:B10' });
await sheets.spreadsheets.values.get({ spreadsheetId, range: 'Sheet2!A1:C20' });

Quota optimization patterns:

// ✅ Use batchUpdate for multiple writes
await sheets.spreadsheets.batchUpdate({
  spreadsheetId,
  requestBody: {
    requests: [
      { updateCells: {...} },
      { repeatCell: {...} },
      { autoResizeDimensions: {...} }
    ]
  }
})

// ❌ Multiple individual updates (100x quota cost)
await sheets.spreadsheets.batchUpdate({ requests: [{ updateCells: {...} }] })
await sheets.spreadsheets.batchUpdate({ requests: [{ repeatCell: {...} }] })

2. Error Recovery Patterns

Validate error handling matches Google's recommendations:

// ✅ Correct: Exponential backoff for 429
try {
  const result = await executeWithRetry(() => sheets.spreadsheets.get({ spreadsheetId }), {
    maxRetries: 3,
    baseDelay: 1000,
    maxDelay: 10000,
  });
} catch (error) {
  if (error.code === 429) {
    // Respect Retry-After header
    const retryAfter = error.response?.headers?.['retry-after'];
    await sleep(retryAfter * 1000);
  }
}

// ❌ Wrong: No retry, wastes quota
const result = await sheets.spreadsheets.get({ spreadsheetId });

Read the full file on GitHub · 403 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 403 lines · 56 tokens per session scan A 270fe528869a

Subscribe to this mod's changes

google-api-expert is an agent published in the GitHub repository khill1269/servalsheets (0 stars, last pushed 10d ago), licensed MIT. It adds 56 tokens to every session and 2,531 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.