Google Health Cache Status
google_health_cache_statusCheck if a local SQLite cache is enabled for Google Health data, and view its status in markdown or JSON format.
Instructions
Show optional local SQLite cache status. Enable with GOOGLE_HEALTH_CACHE=sqlite or GOOGLE_HEALTH_CACHE=true.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| response_format | No | markdown |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| enabled | Yes | ||
| path | Yes | ||
| entries | Yes | ||
| newest_cached_at | No |
Implementation Reference
- src/tools/google-health-tools.ts:300-313 (handler)The registration and handler for the google_health_cache_status tool. Receives the optional response_format, calls client().cacheStatus() to get the status, and returns the result formatted as a bullet list or JSON.
server.registerTool("google_health_cache_status", { title: "Google Health Cache Status", description: "Show optional local SQLite cache status. Enable with GOOGLE_HEALTH_CACHE=sqlite or GOOGLE_HEALTH_CACHE=true.", inputSchema: ResponseOnlyInputSchema.shape, outputSchema: CacheStatusOutputSchema.shape, annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false } }, async ({ response_format }) => { try { const status = client().cacheStatus(); return makeResponse(status, response_format, bulletList("Google Health Cache Status", status)); } catch (error) { return makeError((error as Error).message); } }); - src/schemas/common.ts:153-158 (schema)Zod schema defining the output shape: enabled (boolean), path (string), entries (non-negative integer), and optional newest_cached_at (string).
export const CacheStatusOutputSchema = z.object({ enabled: z.boolean(), path: z.string(), entries: z.number().int().nonnegative(), newest_cached_at: z.string().optional() }).strict(); - src/services/cache.ts:58-61 (handler)The GoogleHealthCache.status() method that queries the SQLite cache database for total entry count and newest cached_at timestamp.
status(): CacheStatus { const row = this.db.prepare("SELECT COUNT(*) AS entries, MAX(cached_at) AS newest_cached_at FROM api_cache").get() as { entries: number; newest_cached_at?: string }; return { enabled: true, path: this.path, entries: row.entries, newest_cached_at: row.newest_cached_at }; } - GoogleHealthClient.cacheStatus() — the method invoked by the tool handler. Returns disabled status if cache is not enabled, otherwise delegates to GoogleHealthCache.status().
cacheStatus(): CacheStatus { if (!this.config.cacheEnabled) return disabledCacheStatus(this.config.cachePath); return this.getCache().status(); } - src/services/cache.ts:64-66 (helper)Helper function that returns a disabled CacheStatus when caching is not configured.
export function disabledCacheStatus(path: string): CacheStatus { return { enabled: false, path, entries: 0 }; }