@tpmjs/tools-neon
Get usage metrics (compute time, storage, data written) for a date range.
Test @tpmjs/tools-neon (getConsumption) with AI-powered execution
0/2000 characters
Install this tool and use it with the AI SDK
npm install @tpmjs/tools-neonpnpm add @tpmjs/tools-neonyarn add @tpmjs/tools-neonbun add @tpmjs/tools-neondeno add npm:@tpmjs/tools-neonimport { getConsumption } from '@tpmjs/tools-neon';import { generateText } from 'ai';
import { openai } from '@ai-sdk/openai';
import { getConsumption } from '@tpmjs/tools-neon';
const result = await generateText({
model: openai('gpt-4o'),
tools: { getConsumption },
prompt: 'Your prompt here...',
});
console.log(result.text);(to: string, from: string, granularity: string, orgId?: string, projectIds?: string) => Promise<unknown>Available configuration options
fromstringStart date in ISO 8601 format (e.g., "2025-01-01T00:00:00Z").
tostringEnd date in ISO 8601 format (e.g., "2025-02-01T00:00:00Z").
granularitystringTime granularity: "hourly" (max 7 days), "daily" (max 60 days), or "monthly" (max 1 year).
projectIdsstringComma-separated project IDs to filter (max 100). Omit for all projects.
orgIdstringOrganization ID. Defaults to the authenticated account.
Schema extracted: 3/1/2026, 4:29:15 AM
Neon serverless Postgres tools for AI agents. Manage projects, branches, databases, compute endpoints, and usage metrics.
npm install @tpmjs/tools-neon
Set the NEON_API_KEY environment variable. Get your key from https://console.neon.tech/app/settings/api-keys
import { listProjects, getConsumption } from '@tpmjs/tools-neon'; // List all projects const projects = await listProjects.execute({}); // Get usage metrics const usage = await getConsumption.execute({ from: '2025-01-01T00:00:00Z', to: '2025-02-01T00:00:00Z', granularity: 'daily', });
| Name | Description |
|---|---|
listProjects | List all Neon projects with optional search filtering |
getProject | Get details of a specific Neon project by ID |
createProject | Create a new project with default branch and database |
deleteProject | Permanently delete a project and all resources |
listBranches | List all branches in a project |
createBranch | Create a branch (instant copy-on-write fork) |
deleteBranch | Delete a branch |
listDatabases | List databases on a branch |
createDatabase | Create a database on a branch |
deleteDatabase | Delete a database |
listEndpoints | List compute endpoints and their status |
startEndpoint | Start a suspended compute endpoint |
suspendEndpoint | Suspend an endpoint to save costs |
getConnectionUri | Get a PostgreSQL connection string |
listOperations | List recent async operations |
getConsumption | Get usage metrics (compute, storage, data) |
MIT
Downloads/month
52
GitHub Stars
8
Quality Score