@nirvana-labs/nirvana-mcp 1.85.2 → 1.86.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -127,6 +127,8 @@ const fuse = new Fuse(
127
127
  'client.organizations.memberships.list',
128
128
  'client.quotas.get',
129
129
  'client.quotas.list',
130
+ 'client.usage.get',
131
+ 'client.usage.list',
130
132
  'client.auditLogs.get',
131
133
  'client.auditLogs.list',
132
134
  'client.projects.create',
@@ -709,6 +709,77 @@ const EMBEDDED_METHODS: MethodEntry[] = [
709
709
  },
710
710
  },
711
711
  },
712
+ {
713
+ name: 'get',
714
+ endpoint: '/v1/usage/{resource_id}',
715
+ httpMethod: 'get',
716
+ summary: 'Get Usage Record',
717
+ description:
718
+ 'Get the usage record for a single resource (metadata plus dimension history) for the current organization.',
719
+ stainlessPath: '(resource) usage > (method) get',
720
+ qualified: 'client.usage.get',
721
+ params: ['resource_id: string;'],
722
+ response:
723
+ "{ dimensions: { id: string; dimension: string; ended_at: string; quantity: number; started_at: string; children?: usage_dimension_leaf[]; }[]; ended_at: string; project_id: string; region: 'us-sva-2'; resource_id: string; resource_type: string; started_at: string; }",
724
+ markdown:
725
+ "## get\n\n`client.usage.get(resource_id: string): { dimensions: usage_dimension[]; ended_at: string; project_id: string; region: region_name; resource_id: string; resource_type: usage_resource_type; started_at: string; }`\n\n**get** `/v1/usage/{resource_id}`\n\nGet the usage record for a single resource (metadata plus dimension history) for the current organization.\n\n### Parameters\n\n- `resource_id: string`\n\n### Returns\n\n- `{ dimensions: { id: string; dimension: string; ended_at: string; quantity: number; started_at: string; children?: usage_dimension_leaf[]; }[]; ended_at: string; project_id: string; region: 'us-sva-2'; resource_id: string; resource_type: string; started_at: string; }`\n Usage record for a single metered resource.\n\n - `dimensions: { id: string; dimension: string; ended_at: string; quantity: number; started_at: string; children?: { id: string; dimension: string; ended_at: string; quantity: number; started_at: string; }[]; }[]`\n - `ended_at: string`\n - `project_id: string`\n - `region: 'us-sva-2'`\n - `resource_id: string`\n - `resource_type: string`\n - `started_at: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\nconst usage = await client.usage.get('123e4567-e89b-12d3-a456-426614174000');\n\nconsole.log(usage);\n```",
726
+ perLanguage: {
727
+ typescript: {
728
+ method: 'client.usage.get',
729
+ example:
730
+ "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\nconst usage = await client.usage.get('123e4567-e89b-12d3-a456-426614174000');\n\nconsole.log(usage.project_id);",
731
+ },
732
+ go: {
733
+ method: 'client.Usage.Get',
734
+ example:
735
+ 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tusage, err := client.Usage.Get(context.TODO(), "123e4567-e89b-12d3-a456-426614174000")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", usage.ProjectID)\n}\n',
736
+ },
737
+ cli: {
738
+ method: 'usage get',
739
+ example:
740
+ "nirvana usage get \\\n --api-key 'My API Key' \\\n --resource-id 123e4567-e89b-12d3-a456-426614174000",
741
+ },
742
+ http: {
743
+ example:
744
+ 'curl https://api.nirvanalabs.io/v1/usage/$RESOURCE_ID \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
745
+ },
746
+ },
747
+ },
748
+ {
749
+ name: 'list',
750
+ endpoint: '/v1/usage',
751
+ httpMethod: 'get',
752
+ summary: 'List Usage Records',
753
+ description:
754
+ 'List per-resource usage records for the current organization. Each item is one resource with its nested dimension history (active and closed segments).',
755
+ stainlessPath: '(resource) usage > (method) list',
756
+ qualified: 'client.usage.list',
757
+ params: ['cursor?: string;', 'limit?: number;'],
758
+ response:
759
+ "{ dimensions: { id: string; dimension: string; ended_at: string; quantity: number; started_at: string; children?: usage_dimension_leaf[]; }[]; ended_at: string; project_id: string; region: 'us-sva-2'; resource_id: string; resource_type: string; started_at: string; }",
760
+ markdown:
761
+ "## list\n\n`client.usage.list(cursor?: string, limit?: number): { dimensions: usage_dimension[]; ended_at: string; project_id: string; region: region_name; resource_id: string; resource_type: usage_resource_type; started_at: string; }`\n\n**get** `/v1/usage`\n\nList per-resource usage records for the current organization. Each item is one resource with its nested dimension history (active and closed segments).\n\n### Parameters\n\n- `cursor?: string`\n Pagination cursor returned by a previous request\n\n- `limit?: number`\n Maximum number of items to return\n\n### Returns\n\n- `{ dimensions: { id: string; dimension: string; ended_at: string; quantity: number; started_at: string; children?: usage_dimension_leaf[]; }[]; ended_at: string; project_id: string; region: 'us-sva-2'; resource_id: string; resource_type: string; started_at: string; }`\n Usage record for a single metered resource.\n\n - `dimensions: { id: string; dimension: string; ended_at: string; quantity: number; started_at: string; children?: { id: string; dimension: string; ended_at: string; quantity: number; started_at: string; }[]; }[]`\n - `ended_at: string`\n - `project_id: string`\n - `region: 'us-sva-2'`\n - `resource_id: string`\n - `resource_type: string`\n - `started_at: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\n// Automatically fetches more pages as needed.\nfor await (const usage of client.usage.list()) {\n console.log(usage);\n}\n```",
762
+ perLanguage: {
763
+ typescript: {
764
+ method: 'client.usage.list',
765
+ example:
766
+ "import NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs({\n apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const usage of client.usage.list()) {\n console.log(usage.project_id);\n}",
767
+ },
768
+ go: {
769
+ method: 'client.Usage.List',
770
+ example:
771
+ 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/nirvana-labs/nirvana-go"\n\t"github.com/nirvana-labs/nirvana-go/option"\n\t"github.com/nirvana-labs/nirvana-go/usage"\n)\n\nfunc main() {\n\tclient := nirvana.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpage, err := client.Usage.List(context.TODO(), usage.UsageListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
772
+ },
773
+ cli: {
774
+ method: 'usage list',
775
+ example: "nirvana usage list \\\n --api-key 'My API Key'",
776
+ },
777
+ http: {
778
+ example:
779
+ 'curl https://api.nirvanalabs.io/v1/usage \\\n -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"',
780
+ },
781
+ },
782
+ },
712
783
  {
713
784
  name: 'get',
714
785
  endpoint: '/v1/audit_logs/{audit_log_id}',
package/src/methods.ts CHANGED
@@ -124,6 +124,18 @@ export const sdkMethods: SdkMethod[] = [
124
124
  httpMethod: 'get',
125
125
  httpPath: '/v1/quotas/{region}',
126
126
  },
127
+ {
128
+ clientCallName: 'client.usage.list',
129
+ fullyQualifiedName: 'usage.list',
130
+ httpMethod: 'get',
131
+ httpPath: '/v1/usage',
132
+ },
133
+ {
134
+ clientCallName: 'client.usage.get',
135
+ fullyQualifiedName: 'usage.get',
136
+ httpMethod: 'get',
137
+ httpPath: '/v1/usage/{resource_id}',
138
+ },
127
139
  {
128
140
  clientCallName: 'client.auditLogs.list',
129
141
  fullyQualifiedName: 'auditLogs.list',
package/src/server.ts CHANGED
@@ -28,7 +28,7 @@ export const newMcpServer = async ({
28
28
  new McpServer(
29
29
  {
30
30
  name: 'nirvana_labs_nirvana_api',
31
- version: '1.85.2',
31
+ version: '1.86.0',
32
32
  },
33
33
  {
34
34
  instructions: await getInstructions({ stainlessApiKey, customInstructionsPath }),