@nirvana-labs/nirvana-mcp 1.27.0 → 1.29.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.
Files changed (50) hide show
  1. package/README.md +2 -0
  2. package/package.json +2 -2
  3. package/server.js +1 -1
  4. package/server.mjs +1 -1
  5. package/src/server.ts +1 -1
  6. package/src/tools/compute/vms/volumes/list-vms-compute-volumes.ts +1 -1
  7. package/src/tools/compute/volumes/attach-compute-volumes.ts +58 -0
  8. package/src/tools/compute/volumes/detach-compute-volumes.ts +52 -0
  9. package/src/tools/compute/volumes/get-compute-volumes.ts +1 -1
  10. package/src/tools/compute/volumes/list-compute-volumes.ts +1 -1
  11. package/src/tools/index.ts +4 -0
  12. package/src/tools/regions/get-regions.ts +5 -5
  13. package/tools/compute/vms/volumes/list-vms-compute-volumes.js +1 -1
  14. package/tools/compute/vms/volumes/list-vms-compute-volumes.js.map +1 -1
  15. package/tools/compute/vms/volumes/list-vms-compute-volumes.mjs +1 -1
  16. package/tools/compute/vms/volumes/list-vms-compute-volumes.mjs.map +1 -1
  17. package/tools/compute/volumes/attach-compute-volumes.d.mts +51 -0
  18. package/tools/compute/volumes/attach-compute-volumes.d.mts.map +1 -0
  19. package/tools/compute/volumes/attach-compute-volumes.d.ts +51 -0
  20. package/tools/compute/volumes/attach-compute-volumes.d.ts.map +1 -0
  21. package/tools/compute/volumes/attach-compute-volumes.js +56 -0
  22. package/tools/compute/volumes/attach-compute-volumes.js.map +1 -0
  23. package/tools/compute/volumes/attach-compute-volumes.mjs +49 -0
  24. package/tools/compute/volumes/attach-compute-volumes.mjs.map +1 -0
  25. package/tools/compute/volumes/detach-compute-volumes.d.mts +51 -0
  26. package/tools/compute/volumes/detach-compute-volumes.d.mts.map +1 -0
  27. package/tools/compute/volumes/detach-compute-volumes.d.ts +51 -0
  28. package/tools/compute/volumes/detach-compute-volumes.d.ts.map +1 -0
  29. package/tools/compute/volumes/detach-compute-volumes.js +52 -0
  30. package/tools/compute/volumes/detach-compute-volumes.js.map +1 -0
  31. package/tools/compute/volumes/detach-compute-volumes.mjs +45 -0
  32. package/tools/compute/volumes/detach-compute-volumes.mjs.map +1 -0
  33. package/tools/compute/volumes/get-compute-volumes.js +1 -1
  34. package/tools/compute/volumes/get-compute-volumes.js.map +1 -1
  35. package/tools/compute/volumes/get-compute-volumes.mjs +1 -1
  36. package/tools/compute/volumes/get-compute-volumes.mjs.map +1 -1
  37. package/tools/compute/volumes/list-compute-volumes.js +1 -1
  38. package/tools/compute/volumes/list-compute-volumes.js.map +1 -1
  39. package/tools/compute/volumes/list-compute-volumes.mjs +1 -1
  40. package/tools/compute/volumes/list-compute-volumes.mjs.map +1 -1
  41. package/tools/index.d.mts.map +1 -1
  42. package/tools/index.d.ts.map +1 -1
  43. package/tools/index.js +4 -0
  44. package/tools/index.js.map +1 -1
  45. package/tools/index.mjs +4 -0
  46. package/tools/index.mjs.map +1 -1
  47. package/tools/regions/get-regions.js +5 -5
  48. package/tools/regions/get-regions.js.map +1 -1
  49. package/tools/regions/get-regions.mjs +5 -5
  50. package/tools/regions/get-regions.mjs.map +1 -1
package/README.md CHANGED
@@ -296,6 +296,8 @@ The following tools are available in this MCP server.
296
296
  - `update_compute_volumes` (`write`): Update a Volume. Boot or data volumes can be updated.
297
297
  - `list_compute_volumes` (`read`): List all volumes
298
298
  - `delete_compute_volumes` (`write`): Delete a Volume. Boot or data volumes can be deleted.
299
+ - `attach_compute_volumes` (`write`): Attach a volume to a VM
300
+ - `detach_compute_volumes` (`write`): Detach a volume from a VM
299
301
  - `get_compute_volumes` (`read`): Get a Volume.
300
302
 
301
303
  ### Resource `compute.volumes.availability`:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nirvana-labs/nirvana-mcp",
3
- "version": "1.27.0",
3
+ "version": "1.29.0",
4
4
  "description": "The official MCP Server for the Nirvana Labs API",
5
5
  "author": "Nirvana Labs <engineering@nirvanalabs.io>",
6
6
  "types": "./index.d.ts",
@@ -18,7 +18,7 @@
18
18
  "access": "public"
19
19
  },
20
20
  "dependencies": {
21
- "@nirvana-labs/nirvana": "^1.27.0",
21
+ "@nirvana-labs/nirvana": "^1.29.0",
22
22
  "@cloudflare/cabidela": "^0.2.4",
23
23
  "@modelcontextprotocol/sdk": "^1.24.0",
24
24
  "@valtown/deno-http-worker": "^0.0.21",
package/server.js CHANGED
@@ -22,7 +22,7 @@ var tools_2 = require("./tools.js");
22
22
  Object.defineProperty(exports, "endpoints", { enumerable: true, get: function () { return tools_2.endpoints; } });
23
23
  const newMcpServer = () => new mcp_js_1.McpServer({
24
24
  name: 'nirvana_labs_nirvana_api',
25
- version: '1.27.0',
25
+ version: '1.29.0',
26
26
  }, { capabilities: { tools: {}, logging: {} } });
27
27
  exports.newMcpServer = newMcpServer;
28
28
  // Create server instance
package/server.mjs CHANGED
@@ -11,7 +11,7 @@ export { ClientType } from "./compat.mjs";
11
11
  export { endpoints } from "./tools.mjs";
12
12
  export const newMcpServer = () => new McpServer({
13
13
  name: 'nirvana_labs_nirvana_api',
14
- version: '1.27.0',
14
+ version: '1.29.0',
15
15
  }, { capabilities: { tools: {}, logging: {} } });
16
16
  // Create server instance
17
17
  export const server = newMcpServer();
package/src/server.ts CHANGED
@@ -34,7 +34,7 @@ export const newMcpServer = () =>
34
34
  new McpServer(
35
35
  {
36
36
  name: 'nirvana_labs_nirvana_api',
37
- version: '1.27.0',
37
+ version: '1.29.0',
38
38
  },
39
39
  { capabilities: { tools: {}, logging: {} } },
40
40
  );
@@ -18,7 +18,7 @@ export const metadata: Metadata = {
18
18
  export const tool: Tool = {
19
19
  name: 'list_vms_compute_volumes',
20
20
  description:
21
- "When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nList VM's Volumes\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/volume_list',\n $defs: {\n volume_list: {\n type: 'object',\n properties: {\n items: {\n type: 'array',\n items: {\n $ref: '#/$defs/volume'\n }\n },\n pagination: {\n $ref: '#/$defs/pagination'\n }\n },\n required: [ 'items',\n 'pagination'\n ]\n },\n volume: {\n type: 'object',\n description: 'Volume details.',\n properties: {\n id: {\n type: 'string',\n description: 'Unique identifier for the Volume.'\n },\n created_at: {\n type: 'string',\n description: 'When the Volume was created.',\n format: 'date-time'\n },\n kind: {\n $ref: '#/$defs/volume_kind'\n },\n name: {\n type: 'string',\n description: 'Name of the Volume.'\n },\n size: {\n type: 'integer',\n description: 'Size of the Volume in GB.'\n },\n status: {\n $ref: '#/$defs/resource_status'\n },\n tags: {\n type: 'array',\n description: 'Tags to attach to the Volume.',\n items: {\n type: 'string'\n }\n },\n type: {\n $ref: '#/$defs/volume_type'\n },\n updated_at: {\n type: 'string',\n description: 'When the Volume was updated.',\n format: 'date-time'\n },\n vm_id: {\n type: 'string',\n description: 'ID of the VM the Volume is attached to.'\n },\n vm_name: {\n type: 'string',\n description: 'Name of the VM the Volume is attached to.'\n }\n },\n required: [ 'id',\n 'created_at',\n 'kind',\n 'name',\n 'size',\n 'status',\n 'tags',\n 'type',\n 'updated_at',\n 'vm_id',\n 'vm_name'\n ]\n },\n volume_kind: {\n type: 'string',\n description: 'Volume kind.',\n enum: [ 'boot',\n 'data'\n ]\n },\n resource_status: {\n type: 'string',\n description: 'Status of the resource.',\n enum: [ 'pending',\n 'creating',\n 'updating',\n 'ready',\n 'deleting',\n 'deleted',\n 'error'\n ]\n },\n volume_type: {\n type: 'string',\n description: 'Type of the Volume.',\n enum: [ 'nvme',\n 'abs'\n ]\n },\n pagination: {\n type: 'object',\n description: 'Pagination response details.',\n properties: {\n next_cursor: {\n type: 'string'\n },\n previous_cursor: {\n type: 'string'\n },\n total_count: {\n type: 'integer'\n }\n },\n required: [ 'next_cursor',\n 'previous_cursor',\n 'total_count'\n ]\n }\n }\n}\n```",
21
+ "When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nList VM's Volumes\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/volume_list',\n $defs: {\n volume_list: {\n type: 'object',\n properties: {\n items: {\n type: 'array',\n items: {\n $ref: '#/$defs/volume'\n }\n },\n pagination: {\n $ref: '#/$defs/pagination'\n }\n },\n required: [ 'items',\n 'pagination'\n ]\n },\n volume: {\n type: 'object',\n description: 'Volume details.',\n properties: {\n id: {\n type: 'string',\n description: 'Unique identifier for the Volume.'\n },\n created_at: {\n type: 'string',\n description: 'When the Volume was created.',\n format: 'date-time'\n },\n kind: {\n $ref: '#/$defs/volume_kind'\n },\n name: {\n type: 'string',\n description: 'Name of the Volume.'\n },\n region: {\n type: 'string',\n description: 'Region where the Volume is located.'\n },\n size: {\n type: 'integer',\n description: 'Size of the Volume in GB.'\n },\n status: {\n $ref: '#/$defs/resource_status'\n },\n tags: {\n type: 'array',\n description: 'Tags to attach to the Volume.',\n items: {\n type: 'string'\n }\n },\n type: {\n $ref: '#/$defs/volume_type'\n },\n updated_at: {\n type: 'string',\n description: 'When the Volume was updated.',\n format: 'date-time'\n },\n vm_id: {\n type: 'string',\n description: 'ID of the VM the Volume is attached to.'\n },\n vm_name: {\n type: 'string',\n description: 'Name of the VM the Volume is attached to.'\n }\n },\n required: [ 'id',\n 'created_at',\n 'kind',\n 'name',\n 'region',\n 'size',\n 'status',\n 'tags',\n 'type',\n 'updated_at',\n 'vm_id',\n 'vm_name'\n ]\n },\n volume_kind: {\n type: 'string',\n description: 'Volume kind.',\n enum: [ 'boot',\n 'data'\n ]\n },\n resource_status: {\n type: 'string',\n description: 'Status of the resource.',\n enum: [ 'pending',\n 'creating',\n 'updating',\n 'ready',\n 'deleting',\n 'deleted',\n 'error'\n ]\n },\n volume_type: {\n type: 'string',\n description: 'Type of the Volume.',\n enum: [ 'nvme',\n 'abs'\n ]\n },\n pagination: {\n type: 'object',\n description: 'Pagination response details.',\n properties: {\n next_cursor: {\n type: 'string'\n },\n previous_cursor: {\n type: 'string'\n },\n total_count: {\n type: 'integer'\n }\n },\n required: [ 'next_cursor',\n 'previous_cursor',\n 'total_count'\n ]\n }\n }\n}\n```",
22
22
  inputSchema: {
23
23
  type: 'object',
24
24
  properties: {
@@ -0,0 +1,58 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { isJqError, maybeFilter } from '@nirvana-labs/nirvana-mcp/filtering';
4
+ import { Metadata, asErrorResult, asTextContentResult } from '@nirvana-labs/nirvana-mcp/tools/types';
5
+
6
+ import { Tool } from '@modelcontextprotocol/sdk/types.js';
7
+ import NirvanaLabs from '@nirvana-labs/nirvana';
8
+
9
+ export const metadata: Metadata = {
10
+ resource: 'compute.volumes',
11
+ operation: 'write',
12
+ tags: [],
13
+ httpMethod: 'post',
14
+ httpPath: '/v1/compute/volumes/{volume_id}/attach',
15
+ operationId: 'attach_volume',
16
+ };
17
+
18
+ export const tool: Tool = {
19
+ name: 'attach_compute_volumes',
20
+ description:
21
+ "When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nAttach a volume to a VM\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/operation',\n $defs: {\n operation: {\n type: 'object',\n description: 'Operation details.',\n properties: {\n id: {\n type: 'string',\n description: 'Unique identifier for the Operation.'\n },\n created_at: {\n type: 'string',\n description: 'When the Operation was created.',\n format: 'date-time'\n },\n kind: {\n $ref: '#/$defs/operation_kind'\n },\n resource_id: {\n type: 'string',\n description: 'ID of the resource that the Operation is acting on.'\n },\n status: {\n $ref: '#/$defs/operation_status'\n },\n type: {\n $ref: '#/$defs/operation_type'\n },\n updated_at: {\n type: 'string',\n description: 'When the Operation was updated.',\n format: 'date-time'\n }\n },\n required: [ 'id',\n 'created_at',\n 'kind',\n 'resource_id',\n 'status',\n 'type',\n 'updated_at'\n ]\n },\n operation_kind: {\n type: 'string',\n description: 'Kind of Operation.',\n enum: [ 'vm',\n 'volume',\n 'vpc',\n 'firewall_rule'\n ]\n },\n operation_status: {\n type: 'string',\n description: 'Status of the Operation.',\n enum: [ 'pending',\n 'running',\n 'done',\n 'failed',\n 'unknown'\n ]\n },\n operation_type: {\n type: 'string',\n description: 'Type of Operation.',\n enum: [ 'create',\n 'update',\n 'delete',\n 'restart'\n ]\n }\n }\n}\n```",
22
+ inputSchema: {
23
+ type: 'object',
24
+ properties: {
25
+ volume_id: {
26
+ type: 'string',
27
+ },
28
+ vm_id: {
29
+ type: 'string',
30
+ description: 'ID of the VM to attach the Volume to.',
31
+ },
32
+ jq_filter: {
33
+ type: 'string',
34
+ title: 'jq Filter',
35
+ description:
36
+ 'A jq filter to apply to the response to include certain fields. Consult the output schema in the tool description to see the fields that are available.\n\nFor example: to include only the `name` field in every object of a results array, you can provide ".results[].name".\n\nFor more information, see the [jq documentation](https://jqlang.org/manual/).',
37
+ },
38
+ },
39
+ required: ['volume_id', 'vm_id'],
40
+ },
41
+ annotations: {},
42
+ };
43
+
44
+ export const handler = async (client: NirvanaLabs, args: Record<string, unknown> | undefined) => {
45
+ const { volume_id, jq_filter, ...body } = args as any;
46
+ try {
47
+ return asTextContentResult(
48
+ await maybeFilter(jq_filter, await client.compute.volumes.attach(volume_id, body)),
49
+ );
50
+ } catch (error) {
51
+ if (error instanceof NirvanaLabs.APIError || isJqError(error)) {
52
+ return asErrorResult(error.message);
53
+ }
54
+ throw error;
55
+ }
56
+ };
57
+
58
+ export default { metadata, tool, handler };
@@ -0,0 +1,52 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { isJqError, maybeFilter } from '@nirvana-labs/nirvana-mcp/filtering';
4
+ import { Metadata, asErrorResult, asTextContentResult } from '@nirvana-labs/nirvana-mcp/tools/types';
5
+
6
+ import { Tool } from '@modelcontextprotocol/sdk/types.js';
7
+ import NirvanaLabs from '@nirvana-labs/nirvana';
8
+
9
+ export const metadata: Metadata = {
10
+ resource: 'compute.volumes',
11
+ operation: 'write',
12
+ tags: [],
13
+ httpMethod: 'post',
14
+ httpPath: '/v1/compute/volumes/{volume_id}/detach',
15
+ operationId: 'detach_volume',
16
+ };
17
+
18
+ export const tool: Tool = {
19
+ name: 'detach_compute_volumes',
20
+ description:
21
+ "When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nDetach a volume from a VM\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/operation',\n $defs: {\n operation: {\n type: 'object',\n description: 'Operation details.',\n properties: {\n id: {\n type: 'string',\n description: 'Unique identifier for the Operation.'\n },\n created_at: {\n type: 'string',\n description: 'When the Operation was created.',\n format: 'date-time'\n },\n kind: {\n $ref: '#/$defs/operation_kind'\n },\n resource_id: {\n type: 'string',\n description: 'ID of the resource that the Operation is acting on.'\n },\n status: {\n $ref: '#/$defs/operation_status'\n },\n type: {\n $ref: '#/$defs/operation_type'\n },\n updated_at: {\n type: 'string',\n description: 'When the Operation was updated.',\n format: 'date-time'\n }\n },\n required: [ 'id',\n 'created_at',\n 'kind',\n 'resource_id',\n 'status',\n 'type',\n 'updated_at'\n ]\n },\n operation_kind: {\n type: 'string',\n description: 'Kind of Operation.',\n enum: [ 'vm',\n 'volume',\n 'vpc',\n 'firewall_rule'\n ]\n },\n operation_status: {\n type: 'string',\n description: 'Status of the Operation.',\n enum: [ 'pending',\n 'running',\n 'done',\n 'failed',\n 'unknown'\n ]\n },\n operation_type: {\n type: 'string',\n description: 'Type of Operation.',\n enum: [ 'create',\n 'update',\n 'delete',\n 'restart'\n ]\n }\n }\n}\n```",
22
+ inputSchema: {
23
+ type: 'object',
24
+ properties: {
25
+ volume_id: {
26
+ type: 'string',
27
+ },
28
+ jq_filter: {
29
+ type: 'string',
30
+ title: 'jq Filter',
31
+ description:
32
+ 'A jq filter to apply to the response to include certain fields. Consult the output schema in the tool description to see the fields that are available.\n\nFor example: to include only the `name` field in every object of a results array, you can provide ".results[].name".\n\nFor more information, see the [jq documentation](https://jqlang.org/manual/).',
33
+ },
34
+ },
35
+ required: ['volume_id'],
36
+ },
37
+ annotations: {},
38
+ };
39
+
40
+ export const handler = async (client: NirvanaLabs, args: Record<string, unknown> | undefined) => {
41
+ const { volume_id, jq_filter, ...body } = args as any;
42
+ try {
43
+ return asTextContentResult(await maybeFilter(jq_filter, await client.compute.volumes.detach(volume_id)));
44
+ } catch (error) {
45
+ if (error instanceof NirvanaLabs.APIError || isJqError(error)) {
46
+ return asErrorResult(error.message);
47
+ }
48
+ throw error;
49
+ }
50
+ };
51
+
52
+ export default { metadata, tool, handler };
@@ -18,7 +18,7 @@ export const metadata: Metadata = {
18
18
  export const tool: Tool = {
19
19
  name: 'get_compute_volumes',
20
20
  description:
21
- "When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nGet a Volume.\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/volume',\n $defs: {\n volume: {\n type: 'object',\n description: 'Volume details.',\n properties: {\n id: {\n type: 'string',\n description: 'Unique identifier for the Volume.'\n },\n created_at: {\n type: 'string',\n description: 'When the Volume was created.',\n format: 'date-time'\n },\n kind: {\n $ref: '#/$defs/volume_kind'\n },\n name: {\n type: 'string',\n description: 'Name of the Volume.'\n },\n size: {\n type: 'integer',\n description: 'Size of the Volume in GB.'\n },\n status: {\n $ref: '#/$defs/resource_status'\n },\n tags: {\n type: 'array',\n description: 'Tags to attach to the Volume.',\n items: {\n type: 'string'\n }\n },\n type: {\n $ref: '#/$defs/volume_type'\n },\n updated_at: {\n type: 'string',\n description: 'When the Volume was updated.',\n format: 'date-time'\n },\n vm_id: {\n type: 'string',\n description: 'ID of the VM the Volume is attached to.'\n },\n vm_name: {\n type: 'string',\n description: 'Name of the VM the Volume is attached to.'\n }\n },\n required: [ 'id',\n 'created_at',\n 'kind',\n 'name',\n 'size',\n 'status',\n 'tags',\n 'type',\n 'updated_at',\n 'vm_id',\n 'vm_name'\n ]\n },\n volume_kind: {\n type: 'string',\n description: 'Volume kind.',\n enum: [ 'boot',\n 'data'\n ]\n },\n resource_status: {\n type: 'string',\n description: 'Status of the resource.',\n enum: [ 'pending',\n 'creating',\n 'updating',\n 'ready',\n 'deleting',\n 'deleted',\n 'error'\n ]\n },\n volume_type: {\n type: 'string',\n description: 'Type of the Volume.',\n enum: [ 'nvme',\n 'abs'\n ]\n }\n }\n}\n```",
21
+ "When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nGet a Volume.\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/volume',\n $defs: {\n volume: {\n type: 'object',\n description: 'Volume details.',\n properties: {\n id: {\n type: 'string',\n description: 'Unique identifier for the Volume.'\n },\n created_at: {\n type: 'string',\n description: 'When the Volume was created.',\n format: 'date-time'\n },\n kind: {\n $ref: '#/$defs/volume_kind'\n },\n name: {\n type: 'string',\n description: 'Name of the Volume.'\n },\n region: {\n type: 'string',\n description: 'Region where the Volume is located.'\n },\n size: {\n type: 'integer',\n description: 'Size of the Volume in GB.'\n },\n status: {\n $ref: '#/$defs/resource_status'\n },\n tags: {\n type: 'array',\n description: 'Tags to attach to the Volume.',\n items: {\n type: 'string'\n }\n },\n type: {\n $ref: '#/$defs/volume_type'\n },\n updated_at: {\n type: 'string',\n description: 'When the Volume was updated.',\n format: 'date-time'\n },\n vm_id: {\n type: 'string',\n description: 'ID of the VM the Volume is attached to.'\n },\n vm_name: {\n type: 'string',\n description: 'Name of the VM the Volume is attached to.'\n }\n },\n required: [ 'id',\n 'created_at',\n 'kind',\n 'name',\n 'region',\n 'size',\n 'status',\n 'tags',\n 'type',\n 'updated_at',\n 'vm_id',\n 'vm_name'\n ]\n },\n volume_kind: {\n type: 'string',\n description: 'Volume kind.',\n enum: [ 'boot',\n 'data'\n ]\n },\n resource_status: {\n type: 'string',\n description: 'Status of the resource.',\n enum: [ 'pending',\n 'creating',\n 'updating',\n 'ready',\n 'deleting',\n 'deleted',\n 'error'\n ]\n },\n volume_type: {\n type: 'string',\n description: 'Type of the Volume.',\n enum: [ 'nvme',\n 'abs'\n ]\n }\n }\n}\n```",
22
22
  inputSchema: {
23
23
  type: 'object',
24
24
  properties: {
@@ -18,7 +18,7 @@ export const metadata: Metadata = {
18
18
  export const tool: Tool = {
19
19
  name: 'list_compute_volumes',
20
20
  description:
21
- "When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nList all volumes\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/volume_list',\n $defs: {\n volume_list: {\n type: 'object',\n properties: {\n items: {\n type: 'array',\n items: {\n $ref: '#/$defs/volume'\n }\n },\n pagination: {\n $ref: '#/$defs/pagination'\n }\n },\n required: [ 'items',\n 'pagination'\n ]\n },\n volume: {\n type: 'object',\n description: 'Volume details.',\n properties: {\n id: {\n type: 'string',\n description: 'Unique identifier for the Volume.'\n },\n created_at: {\n type: 'string',\n description: 'When the Volume was created.',\n format: 'date-time'\n },\n kind: {\n $ref: '#/$defs/volume_kind'\n },\n name: {\n type: 'string',\n description: 'Name of the Volume.'\n },\n size: {\n type: 'integer',\n description: 'Size of the Volume in GB.'\n },\n status: {\n $ref: '#/$defs/resource_status'\n },\n tags: {\n type: 'array',\n description: 'Tags to attach to the Volume.',\n items: {\n type: 'string'\n }\n },\n type: {\n $ref: '#/$defs/volume_type'\n },\n updated_at: {\n type: 'string',\n description: 'When the Volume was updated.',\n format: 'date-time'\n },\n vm_id: {\n type: 'string',\n description: 'ID of the VM the Volume is attached to.'\n },\n vm_name: {\n type: 'string',\n description: 'Name of the VM the Volume is attached to.'\n }\n },\n required: [ 'id',\n 'created_at',\n 'kind',\n 'name',\n 'size',\n 'status',\n 'tags',\n 'type',\n 'updated_at',\n 'vm_id',\n 'vm_name'\n ]\n },\n volume_kind: {\n type: 'string',\n description: 'Volume kind.',\n enum: [ 'boot',\n 'data'\n ]\n },\n resource_status: {\n type: 'string',\n description: 'Status of the resource.',\n enum: [ 'pending',\n 'creating',\n 'updating',\n 'ready',\n 'deleting',\n 'deleted',\n 'error'\n ]\n },\n volume_type: {\n type: 'string',\n description: 'Type of the Volume.',\n enum: [ 'nvme',\n 'abs'\n ]\n },\n pagination: {\n type: 'object',\n description: 'Pagination response details.',\n properties: {\n next_cursor: {\n type: 'string'\n },\n previous_cursor: {\n type: 'string'\n },\n total_count: {\n type: 'integer'\n }\n },\n required: [ 'next_cursor',\n 'previous_cursor',\n 'total_count'\n ]\n }\n }\n}\n```",
21
+ "When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nList all volumes\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/volume_list',\n $defs: {\n volume_list: {\n type: 'object',\n properties: {\n items: {\n type: 'array',\n items: {\n $ref: '#/$defs/volume'\n }\n },\n pagination: {\n $ref: '#/$defs/pagination'\n }\n },\n required: [ 'items',\n 'pagination'\n ]\n },\n volume: {\n type: 'object',\n description: 'Volume details.',\n properties: {\n id: {\n type: 'string',\n description: 'Unique identifier for the Volume.'\n },\n created_at: {\n type: 'string',\n description: 'When the Volume was created.',\n format: 'date-time'\n },\n kind: {\n $ref: '#/$defs/volume_kind'\n },\n name: {\n type: 'string',\n description: 'Name of the Volume.'\n },\n region: {\n type: 'string',\n description: 'Region where the Volume is located.'\n },\n size: {\n type: 'integer',\n description: 'Size of the Volume in GB.'\n },\n status: {\n $ref: '#/$defs/resource_status'\n },\n tags: {\n type: 'array',\n description: 'Tags to attach to the Volume.',\n items: {\n type: 'string'\n }\n },\n type: {\n $ref: '#/$defs/volume_type'\n },\n updated_at: {\n type: 'string',\n description: 'When the Volume was updated.',\n format: 'date-time'\n },\n vm_id: {\n type: 'string',\n description: 'ID of the VM the Volume is attached to.'\n },\n vm_name: {\n type: 'string',\n description: 'Name of the VM the Volume is attached to.'\n }\n },\n required: [ 'id',\n 'created_at',\n 'kind',\n 'name',\n 'region',\n 'size',\n 'status',\n 'tags',\n 'type',\n 'updated_at',\n 'vm_id',\n 'vm_name'\n ]\n },\n volume_kind: {\n type: 'string',\n description: 'Volume kind.',\n enum: [ 'boot',\n 'data'\n ]\n },\n resource_status: {\n type: 'string',\n description: 'Status of the resource.',\n enum: [ 'pending',\n 'creating',\n 'updating',\n 'ready',\n 'deleting',\n 'deleted',\n 'error'\n ]\n },\n volume_type: {\n type: 'string',\n description: 'Type of the Volume.',\n enum: [ 'nvme',\n 'abs'\n ]\n },\n pagination: {\n type: 'object',\n description: 'Pagination response details.',\n properties: {\n next_cursor: {\n type: 'string'\n },\n previous_cursor: {\n type: 'string'\n },\n total_count: {\n type: 'integer'\n }\n },\n required: [ 'next_cursor',\n 'previous_cursor',\n 'total_count'\n ]\n }\n }\n}\n```",
22
22
  inputSchema: {
23
23
  type: 'object',
24
24
  properties: {
@@ -33,6 +33,8 @@ import create_compute_volumes from './compute/volumes/create-compute-volumes';
33
33
  import update_compute_volumes from './compute/volumes/update-compute-volumes';
34
34
  import list_compute_volumes from './compute/volumes/list-compute-volumes';
35
35
  import delete_compute_volumes from './compute/volumes/delete-compute-volumes';
36
+ import attach_compute_volumes from './compute/volumes/attach-compute-volumes';
37
+ import detach_compute_volumes from './compute/volumes/detach-compute-volumes';
36
38
  import get_compute_volumes from './compute/volumes/get-compute-volumes';
37
39
  import create_volumes_compute_availability from './compute/volumes/availability/create-volumes-compute-availability';
38
40
  import update_volumes_compute_availability from './compute/volumes/availability/update-volumes-compute-availability';
@@ -148,6 +150,8 @@ addEndpoint(create_compute_volumes);
148
150
  addEndpoint(update_compute_volumes);
149
151
  addEndpoint(list_compute_volumes);
150
152
  addEndpoint(delete_compute_volumes);
153
+ addEndpoint(attach_compute_volumes);
154
+ addEndpoint(detach_compute_volumes);
151
155
  addEndpoint(get_compute_volumes);
152
156
  addEndpoint(create_volumes_compute_availability);
153
157
  addEndpoint(update_volumes_compute_availability);
@@ -11,7 +11,7 @@ export const metadata: Metadata = {
11
11
  operation: 'read',
12
12
  tags: [],
13
13
  httpMethod: 'get',
14
- httpPath: '/v1/regions/{region_name}',
14
+ httpPath: '/v1/regions/{name}',
15
15
  operationId: 'get_region',
16
16
  };
17
17
 
@@ -22,7 +22,7 @@ export const tool: Tool = {
22
22
  inputSchema: {
23
23
  type: 'object',
24
24
  properties: {
25
- region_name: {
25
+ name: {
26
26
  type: 'string',
27
27
  },
28
28
  jq_filter: {
@@ -32,7 +32,7 @@ export const tool: Tool = {
32
32
  'A jq filter to apply to the response to include certain fields. Consult the output schema in the tool description to see the fields that are available.\n\nFor example: to include only the `name` field in every object of a results array, you can provide ".results[].name".\n\nFor more information, see the [jq documentation](https://jqlang.org/manual/).',
33
33
  },
34
34
  },
35
- required: ['region_name'],
35
+ required: ['name'],
36
36
  },
37
37
  annotations: {
38
38
  readOnlyHint: true,
@@ -40,9 +40,9 @@ export const tool: Tool = {
40
40
  };
41
41
 
42
42
  export const handler = async (client: NirvanaLabs, args: Record<string, unknown> | undefined) => {
43
- const { region_name, jq_filter, ...body } = args as any;
43
+ const { name, jq_filter, ...body } = args as any;
44
44
  try {
45
- return asTextContentResult(await maybeFilter(jq_filter, await client.regions.get(region_name)));
45
+ return asTextContentResult(await maybeFilter(jq_filter, await client.regions.get(name)));
46
46
  } catch (error) {
47
47
  if (error instanceof NirvanaLabs.APIError || isJqError(error)) {
48
48
  return asErrorResult(error.message);
@@ -18,7 +18,7 @@ exports.metadata = {
18
18
  };
19
19
  exports.tool = {
20
20
  name: 'list_vms_compute_volumes',
21
- description: "When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nList VM's Volumes\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/volume_list',\n $defs: {\n volume_list: {\n type: 'object',\n properties: {\n items: {\n type: 'array',\n items: {\n $ref: '#/$defs/volume'\n }\n },\n pagination: {\n $ref: '#/$defs/pagination'\n }\n },\n required: [ 'items',\n 'pagination'\n ]\n },\n volume: {\n type: 'object',\n description: 'Volume details.',\n properties: {\n id: {\n type: 'string',\n description: 'Unique identifier for the Volume.'\n },\n created_at: {\n type: 'string',\n description: 'When the Volume was created.',\n format: 'date-time'\n },\n kind: {\n $ref: '#/$defs/volume_kind'\n },\n name: {\n type: 'string',\n description: 'Name of the Volume.'\n },\n size: {\n type: 'integer',\n description: 'Size of the Volume in GB.'\n },\n status: {\n $ref: '#/$defs/resource_status'\n },\n tags: {\n type: 'array',\n description: 'Tags to attach to the Volume.',\n items: {\n type: 'string'\n }\n },\n type: {\n $ref: '#/$defs/volume_type'\n },\n updated_at: {\n type: 'string',\n description: 'When the Volume was updated.',\n format: 'date-time'\n },\n vm_id: {\n type: 'string',\n description: 'ID of the VM the Volume is attached to.'\n },\n vm_name: {\n type: 'string',\n description: 'Name of the VM the Volume is attached to.'\n }\n },\n required: [ 'id',\n 'created_at',\n 'kind',\n 'name',\n 'size',\n 'status',\n 'tags',\n 'type',\n 'updated_at',\n 'vm_id',\n 'vm_name'\n ]\n },\n volume_kind: {\n type: 'string',\n description: 'Volume kind.',\n enum: [ 'boot',\n 'data'\n ]\n },\n resource_status: {\n type: 'string',\n description: 'Status of the resource.',\n enum: [ 'pending',\n 'creating',\n 'updating',\n 'ready',\n 'deleting',\n 'deleted',\n 'error'\n ]\n },\n volume_type: {\n type: 'string',\n description: 'Type of the Volume.',\n enum: [ 'nvme',\n 'abs'\n ]\n },\n pagination: {\n type: 'object',\n description: 'Pagination response details.',\n properties: {\n next_cursor: {\n type: 'string'\n },\n previous_cursor: {\n type: 'string'\n },\n total_count: {\n type: 'integer'\n }\n },\n required: [ 'next_cursor',\n 'previous_cursor',\n 'total_count'\n ]\n }\n }\n}\n```",
21
+ description: "When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nList VM's Volumes\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/volume_list',\n $defs: {\n volume_list: {\n type: 'object',\n properties: {\n items: {\n type: 'array',\n items: {\n $ref: '#/$defs/volume'\n }\n },\n pagination: {\n $ref: '#/$defs/pagination'\n }\n },\n required: [ 'items',\n 'pagination'\n ]\n },\n volume: {\n type: 'object',\n description: 'Volume details.',\n properties: {\n id: {\n type: 'string',\n description: 'Unique identifier for the Volume.'\n },\n created_at: {\n type: 'string',\n description: 'When the Volume was created.',\n format: 'date-time'\n },\n kind: {\n $ref: '#/$defs/volume_kind'\n },\n name: {\n type: 'string',\n description: 'Name of the Volume.'\n },\n region: {\n type: 'string',\n description: 'Region where the Volume is located.'\n },\n size: {\n type: 'integer',\n description: 'Size of the Volume in GB.'\n },\n status: {\n $ref: '#/$defs/resource_status'\n },\n tags: {\n type: 'array',\n description: 'Tags to attach to the Volume.',\n items: {\n type: 'string'\n }\n },\n type: {\n $ref: '#/$defs/volume_type'\n },\n updated_at: {\n type: 'string',\n description: 'When the Volume was updated.',\n format: 'date-time'\n },\n vm_id: {\n type: 'string',\n description: 'ID of the VM the Volume is attached to.'\n },\n vm_name: {\n type: 'string',\n description: 'Name of the VM the Volume is attached to.'\n }\n },\n required: [ 'id',\n 'created_at',\n 'kind',\n 'name',\n 'region',\n 'size',\n 'status',\n 'tags',\n 'type',\n 'updated_at',\n 'vm_id',\n 'vm_name'\n ]\n },\n volume_kind: {\n type: 'string',\n description: 'Volume kind.',\n enum: [ 'boot',\n 'data'\n ]\n },\n resource_status: {\n type: 'string',\n description: 'Status of the resource.',\n enum: [ 'pending',\n 'creating',\n 'updating',\n 'ready',\n 'deleting',\n 'deleted',\n 'error'\n ]\n },\n volume_type: {\n type: 'string',\n description: 'Type of the Volume.',\n enum: [ 'nvme',\n 'abs'\n ]\n },\n pagination: {\n type: 'object',\n description: 'Pagination response details.',\n properties: {\n next_cursor: {\n type: 'string'\n },\n previous_cursor: {\n type: 'string'\n },\n total_count: {\n type: 'integer'\n }\n },\n required: [ 'next_cursor',\n 'previous_cursor',\n 'total_count'\n ]\n }\n }\n}\n```",
22
22
  inputSchema: {
23
23
  type: 'object',
24
24
  properties: {
@@ -1 +1 @@
1
- {"version":3,"file":"list-vms-compute-volumes.js","sourceRoot":"","sources":["../../../../src/tools/compute/vms/volumes/list-vms-compute-volumes.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;AAEtF,mEAA6E;AAC7E,iEAAqG;AAGrG,oEAAgD;AAEnC,QAAA,QAAQ,GAAa;IAChC,QAAQ,EAAE,qBAAqB;IAC/B,SAAS,EAAE,MAAM;IACjB,IAAI,EAAE,EAAE;IACR,UAAU,EAAE,KAAK;IACjB,QAAQ,EAAE,iCAAiC;IAC3C,WAAW,EAAE,iBAAiB;CAC/B,CAAC;AAEW,QAAA,IAAI,GAAS;IACxB,IAAI,EAAE,0BAA0B;IAChC,WAAW,EACT,4nGAA4nG;IAC9nG,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;aACf;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,kDAAkD;aAChE;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,mCAAmC;aACjD;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,WAAW;gBAClB,WAAW,EACT,kWAAkW;aACrW;SACF;QACD,QAAQ,EAAE,CAAC,OAAO,CAAC;KACpB;IACD,WAAW,EAAE;QACX,YAAY,EAAE,IAAI;KACnB;CACF,CAAC;AAEK,MAAM,OAAO,GAAG,KAAK,EAAE,MAAmB,EAAE,IAAyC,EAAE,EAAE;IAC9F,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,IAAW,CAAC;IAClD,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;IACjF,IAAI,CAAC;QACH,OAAO,IAAA,2BAAmB,EAAC,MAAM,IAAA,uBAAW,EAAC,SAAS,EAAE,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IAClF,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,iBAAW,CAAC,QAAQ,IAAI,IAAA,qBAAS,EAAC,KAAK,CAAC,EAAE,CAAC;YAC9D,OAAO,IAAA,qBAAa,EAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACtC,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAC;AAXW,QAAA,OAAO,WAWlB;AAEF,kBAAe,EAAE,QAAQ,EAAR,gBAAQ,EAAE,IAAI,EAAJ,YAAI,EAAE,OAAO,EAAP,eAAO,EAAE,CAAC"}
1
+ {"version":3,"file":"list-vms-compute-volumes.js","sourceRoot":"","sources":["../../../../src/tools/compute/vms/volumes/list-vms-compute-volumes.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;AAEtF,mEAA6E;AAC7E,iEAAqG;AAGrG,oEAAgD;AAEnC,QAAA,QAAQ,GAAa;IAChC,QAAQ,EAAE,qBAAqB;IAC/B,SAAS,EAAE,MAAM;IACjB,IAAI,EAAE,EAAE;IACR,UAAU,EAAE,KAAK;IACjB,QAAQ,EAAE,iCAAiC;IAC3C,WAAW,EAAE,iBAAiB;CAC/B,CAAC;AAEW,QAAA,IAAI,GAAS;IACxB,IAAI,EAAE,0BAA0B;IAChC,WAAW,EACT,uwGAAuwG;IACzwG,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;aACf;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,kDAAkD;aAChE;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,mCAAmC;aACjD;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,WAAW;gBAClB,WAAW,EACT,kWAAkW;aACrW;SACF;QACD,QAAQ,EAAE,CAAC,OAAO,CAAC;KACpB;IACD,WAAW,EAAE;QACX,YAAY,EAAE,IAAI;KACnB;CACF,CAAC;AAEK,MAAM,OAAO,GAAG,KAAK,EAAE,MAAmB,EAAE,IAAyC,EAAE,EAAE;IAC9F,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,IAAW,CAAC;IAClD,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;IACjF,IAAI,CAAC;QACH,OAAO,IAAA,2BAAmB,EAAC,MAAM,IAAA,uBAAW,EAAC,SAAS,EAAE,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IAClF,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,iBAAW,CAAC,QAAQ,IAAI,IAAA,qBAAS,EAAC,KAAK,CAAC,EAAE,CAAC;YAC9D,OAAO,IAAA,qBAAa,EAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACtC,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAC;AAXW,QAAA,OAAO,WAWlB;AAEF,kBAAe,EAAE,QAAQ,EAAR,gBAAQ,EAAE,IAAI,EAAJ,YAAI,EAAE,OAAO,EAAP,eAAO,EAAE,CAAC"}
@@ -12,7 +12,7 @@ export const metadata = {
12
12
  };
13
13
  export const tool = {
14
14
  name: 'list_vms_compute_volumes',
15
- description: "When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nList VM's Volumes\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/volume_list',\n $defs: {\n volume_list: {\n type: 'object',\n properties: {\n items: {\n type: 'array',\n items: {\n $ref: '#/$defs/volume'\n }\n },\n pagination: {\n $ref: '#/$defs/pagination'\n }\n },\n required: [ 'items',\n 'pagination'\n ]\n },\n volume: {\n type: 'object',\n description: 'Volume details.',\n properties: {\n id: {\n type: 'string',\n description: 'Unique identifier for the Volume.'\n },\n created_at: {\n type: 'string',\n description: 'When the Volume was created.',\n format: 'date-time'\n },\n kind: {\n $ref: '#/$defs/volume_kind'\n },\n name: {\n type: 'string',\n description: 'Name of the Volume.'\n },\n size: {\n type: 'integer',\n description: 'Size of the Volume in GB.'\n },\n status: {\n $ref: '#/$defs/resource_status'\n },\n tags: {\n type: 'array',\n description: 'Tags to attach to the Volume.',\n items: {\n type: 'string'\n }\n },\n type: {\n $ref: '#/$defs/volume_type'\n },\n updated_at: {\n type: 'string',\n description: 'When the Volume was updated.',\n format: 'date-time'\n },\n vm_id: {\n type: 'string',\n description: 'ID of the VM the Volume is attached to.'\n },\n vm_name: {\n type: 'string',\n description: 'Name of the VM the Volume is attached to.'\n }\n },\n required: [ 'id',\n 'created_at',\n 'kind',\n 'name',\n 'size',\n 'status',\n 'tags',\n 'type',\n 'updated_at',\n 'vm_id',\n 'vm_name'\n ]\n },\n volume_kind: {\n type: 'string',\n description: 'Volume kind.',\n enum: [ 'boot',\n 'data'\n ]\n },\n resource_status: {\n type: 'string',\n description: 'Status of the resource.',\n enum: [ 'pending',\n 'creating',\n 'updating',\n 'ready',\n 'deleting',\n 'deleted',\n 'error'\n ]\n },\n volume_type: {\n type: 'string',\n description: 'Type of the Volume.',\n enum: [ 'nvme',\n 'abs'\n ]\n },\n pagination: {\n type: 'object',\n description: 'Pagination response details.',\n properties: {\n next_cursor: {\n type: 'string'\n },\n previous_cursor: {\n type: 'string'\n },\n total_count: {\n type: 'integer'\n }\n },\n required: [ 'next_cursor',\n 'previous_cursor',\n 'total_count'\n ]\n }\n }\n}\n```",
15
+ description: "When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nList VM's Volumes\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/volume_list',\n $defs: {\n volume_list: {\n type: 'object',\n properties: {\n items: {\n type: 'array',\n items: {\n $ref: '#/$defs/volume'\n }\n },\n pagination: {\n $ref: '#/$defs/pagination'\n }\n },\n required: [ 'items',\n 'pagination'\n ]\n },\n volume: {\n type: 'object',\n description: 'Volume details.',\n properties: {\n id: {\n type: 'string',\n description: 'Unique identifier for the Volume.'\n },\n created_at: {\n type: 'string',\n description: 'When the Volume was created.',\n format: 'date-time'\n },\n kind: {\n $ref: '#/$defs/volume_kind'\n },\n name: {\n type: 'string',\n description: 'Name of the Volume.'\n },\n region: {\n type: 'string',\n description: 'Region where the Volume is located.'\n },\n size: {\n type: 'integer',\n description: 'Size of the Volume in GB.'\n },\n status: {\n $ref: '#/$defs/resource_status'\n },\n tags: {\n type: 'array',\n description: 'Tags to attach to the Volume.',\n items: {\n type: 'string'\n }\n },\n type: {\n $ref: '#/$defs/volume_type'\n },\n updated_at: {\n type: 'string',\n description: 'When the Volume was updated.',\n format: 'date-time'\n },\n vm_id: {\n type: 'string',\n description: 'ID of the VM the Volume is attached to.'\n },\n vm_name: {\n type: 'string',\n description: 'Name of the VM the Volume is attached to.'\n }\n },\n required: [ 'id',\n 'created_at',\n 'kind',\n 'name',\n 'region',\n 'size',\n 'status',\n 'tags',\n 'type',\n 'updated_at',\n 'vm_id',\n 'vm_name'\n ]\n },\n volume_kind: {\n type: 'string',\n description: 'Volume kind.',\n enum: [ 'boot',\n 'data'\n ]\n },\n resource_status: {\n type: 'string',\n description: 'Status of the resource.',\n enum: [ 'pending',\n 'creating',\n 'updating',\n 'ready',\n 'deleting',\n 'deleted',\n 'error'\n ]\n },\n volume_type: {\n type: 'string',\n description: 'Type of the Volume.',\n enum: [ 'nvme',\n 'abs'\n ]\n },\n pagination: {\n type: 'object',\n description: 'Pagination response details.',\n properties: {\n next_cursor: {\n type: 'string'\n },\n previous_cursor: {\n type: 'string'\n },\n total_count: {\n type: 'integer'\n }\n },\n required: [ 'next_cursor',\n 'previous_cursor',\n 'total_count'\n ]\n }\n }\n}\n```",
16
16
  inputSchema: {
17
17
  type: 'object',
18
18
  properties: {
@@ -1 +1 @@
1
- {"version":3,"file":"list-vms-compute-volumes.mjs","sourceRoot":"","sources":["../../../../src/tools/compute/vms/volumes/list-vms-compute-volumes.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,qCAAqC;OACrE,EAAY,aAAa,EAAE,mBAAmB,EAAE,MAAM,uCAAuC;OAG7F,WAAW,MAAM,uBAAuB;AAE/C,MAAM,CAAC,MAAM,QAAQ,GAAa;IAChC,QAAQ,EAAE,qBAAqB;IAC/B,SAAS,EAAE,MAAM;IACjB,IAAI,EAAE,EAAE;IACR,UAAU,EAAE,KAAK;IACjB,QAAQ,EAAE,iCAAiC;IAC3C,WAAW,EAAE,iBAAiB;CAC/B,CAAC;AAEF,MAAM,CAAC,MAAM,IAAI,GAAS;IACxB,IAAI,EAAE,0BAA0B;IAChC,WAAW,EACT,4nGAA4nG;IAC9nG,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;aACf;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,kDAAkD;aAChE;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,mCAAmC;aACjD;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,WAAW;gBAClB,WAAW,EACT,kWAAkW;aACrW;SACF;QACD,QAAQ,EAAE,CAAC,OAAO,CAAC;KACpB;IACD,WAAW,EAAE;QACX,YAAY,EAAE,IAAI;KACnB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,KAAK,EAAE,MAAmB,EAAE,IAAyC,EAAE,EAAE;IAC9F,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,IAAW,CAAC;IAClD,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;IACjF,IAAI,CAAC;QACH,OAAO,mBAAmB,CAAC,MAAM,WAAW,CAAC,SAAS,EAAE,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IAClF,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,WAAW,CAAC,QAAQ,IAAI,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC;YAC9D,OAAO,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACtC,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC"}
1
+ {"version":3,"file":"list-vms-compute-volumes.mjs","sourceRoot":"","sources":["../../../../src/tools/compute/vms/volumes/list-vms-compute-volumes.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,qCAAqC;OACrE,EAAY,aAAa,EAAE,mBAAmB,EAAE,MAAM,uCAAuC;OAG7F,WAAW,MAAM,uBAAuB;AAE/C,MAAM,CAAC,MAAM,QAAQ,GAAa;IAChC,QAAQ,EAAE,qBAAqB;IAC/B,SAAS,EAAE,MAAM;IACjB,IAAI,EAAE,EAAE;IACR,UAAU,EAAE,KAAK;IACjB,QAAQ,EAAE,iCAAiC;IAC3C,WAAW,EAAE,iBAAiB;CAC/B,CAAC;AAEF,MAAM,CAAC,MAAM,IAAI,GAAS;IACxB,IAAI,EAAE,0BAA0B;IAChC,WAAW,EACT,uwGAAuwG;IACzwG,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;aACf;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,kDAAkD;aAChE;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,mCAAmC;aACjD;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,WAAW;gBAClB,WAAW,EACT,kWAAkW;aACrW;SACF;QACD,QAAQ,EAAE,CAAC,OAAO,CAAC;KACpB;IACD,WAAW,EAAE;QACX,YAAY,EAAE,IAAI;KACnB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,KAAK,EAAE,MAAmB,EAAE,IAAyC,EAAE,EAAE;IAC9F,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,IAAW,CAAC;IAClD,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;IACjF,IAAI,CAAC;QACH,OAAO,mBAAmB,CAAC,MAAM,WAAW,CAAC,SAAS,EAAE,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IAClF,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,WAAW,CAAC,QAAQ,IAAI,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC;YAC9D,OAAO,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACtC,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC"}
@@ -0,0 +1,51 @@
1
+ import { Metadata } from '@nirvana-labs/nirvana-mcp/tools/types';
2
+ import { Tool } from '@modelcontextprotocol/sdk/types.js';
3
+ import NirvanaLabs from '@nirvana-labs/nirvana';
4
+ export declare const metadata: Metadata;
5
+ export declare const tool: Tool;
6
+ export declare const handler: (client: NirvanaLabs, args: Record<string, unknown> | undefined) => Promise<import("@nirvana-labs/nirvana-mcp/tools/types").ToolCallResult>;
7
+ declare const _default: {
8
+ metadata: Metadata;
9
+ tool: {
10
+ inputSchema: {
11
+ [x: string]: unknown;
12
+ type: "object";
13
+ properties?: {
14
+ [x: string]: object;
15
+ } | undefined;
16
+ required?: string[] | undefined;
17
+ };
18
+ name: string;
19
+ description?: string | undefined;
20
+ outputSchema?: {
21
+ [x: string]: unknown;
22
+ type: "object";
23
+ properties?: {
24
+ [x: string]: object;
25
+ } | undefined;
26
+ required?: string[] | undefined;
27
+ } | undefined;
28
+ annotations?: {
29
+ title?: string | undefined;
30
+ readOnlyHint?: boolean | undefined;
31
+ destructiveHint?: boolean | undefined;
32
+ idempotentHint?: boolean | undefined;
33
+ openWorldHint?: boolean | undefined;
34
+ } | undefined;
35
+ execution?: {
36
+ taskSupport?: "optional" | "required" | "forbidden" | undefined;
37
+ } | undefined;
38
+ _meta?: {
39
+ [x: string]: unknown;
40
+ } | undefined;
41
+ icons?: {
42
+ src: string;
43
+ mimeType?: string | undefined;
44
+ sizes?: string[] | undefined;
45
+ }[] | undefined;
46
+ title?: string | undefined;
47
+ };
48
+ handler: (client: NirvanaLabs, args: Record<string, unknown> | undefined) => Promise<import("@nirvana-labs/nirvana-mcp/tools/types").ToolCallResult>;
49
+ };
50
+ export default _default;
51
+ //# sourceMappingURL=attach-compute-volumes.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attach-compute-volumes.d.mts","sourceRoot":"","sources":["../../../src/tools/compute/volumes/attach-compute-volumes.ts"],"names":[],"mappings":"OAGO,EAAE,QAAQ,EAAsC,MAAM,uCAAuC;OAE7F,EAAE,IAAI,EAAE,MAAM,oCAAoC;OAClD,WAAW,MAAM,uBAAuB;AAE/C,eAAO,MAAM,QAAQ,EAAE,QAOtB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,IAwBlB,CAAC;AAEF,eAAO,MAAM,OAAO,GAAU,QAAQ,WAAW,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,4EAY3F,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAZoC,WAAW,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;;AAc5F,wBAA2C"}
@@ -0,0 +1,51 @@
1
+ import { Metadata } from '@nirvana-labs/nirvana-mcp/tools/types';
2
+ import { Tool } from '@modelcontextprotocol/sdk/types.js';
3
+ import NirvanaLabs from '@nirvana-labs/nirvana';
4
+ export declare const metadata: Metadata;
5
+ export declare const tool: Tool;
6
+ export declare const handler: (client: NirvanaLabs, args: Record<string, unknown> | undefined) => Promise<import("@nirvana-labs/nirvana-mcp/tools/types").ToolCallResult>;
7
+ declare const _default: {
8
+ metadata: Metadata;
9
+ tool: {
10
+ inputSchema: {
11
+ [x: string]: unknown;
12
+ type: "object";
13
+ properties?: {
14
+ [x: string]: object;
15
+ } | undefined;
16
+ required?: string[] | undefined;
17
+ };
18
+ name: string;
19
+ description?: string | undefined;
20
+ outputSchema?: {
21
+ [x: string]: unknown;
22
+ type: "object";
23
+ properties?: {
24
+ [x: string]: object;
25
+ } | undefined;
26
+ required?: string[] | undefined;
27
+ } | undefined;
28
+ annotations?: {
29
+ title?: string | undefined;
30
+ readOnlyHint?: boolean | undefined;
31
+ destructiveHint?: boolean | undefined;
32
+ idempotentHint?: boolean | undefined;
33
+ openWorldHint?: boolean | undefined;
34
+ } | undefined;
35
+ execution?: {
36
+ taskSupport?: "optional" | "required" | "forbidden" | undefined;
37
+ } | undefined;
38
+ _meta?: {
39
+ [x: string]: unknown;
40
+ } | undefined;
41
+ icons?: {
42
+ src: string;
43
+ mimeType?: string | undefined;
44
+ sizes?: string[] | undefined;
45
+ }[] | undefined;
46
+ title?: string | undefined;
47
+ };
48
+ handler: (client: NirvanaLabs, args: Record<string, unknown> | undefined) => Promise<import("@nirvana-labs/nirvana-mcp/tools/types").ToolCallResult>;
49
+ };
50
+ export default _default;
51
+ //# sourceMappingURL=attach-compute-volumes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attach-compute-volumes.d.ts","sourceRoot":"","sources":["../../../src/tools/compute/volumes/attach-compute-volumes.ts"],"names":[],"mappings":"OAGO,EAAE,QAAQ,EAAsC,MAAM,uCAAuC;OAE7F,EAAE,IAAI,EAAE,MAAM,oCAAoC;OAClD,WAAW,MAAM,uBAAuB;AAE/C,eAAO,MAAM,QAAQ,EAAE,QAOtB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,IAwBlB,CAAC;AAEF,eAAO,MAAM,OAAO,GAAU,QAAQ,WAAW,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,4EAY3F,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAZoC,WAAW,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;;AAc5F,wBAA2C"}
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.handler = exports.tool = exports.metadata = void 0;
8
+ const filtering_1 = require("@nirvana-labs/nirvana-mcp/filtering");
9
+ const types_1 = require("@nirvana-labs/nirvana-mcp/tools/types");
10
+ const nirvana_1 = __importDefault(require("@nirvana-labs/nirvana"));
11
+ exports.metadata = {
12
+ resource: 'compute.volumes',
13
+ operation: 'write',
14
+ tags: [],
15
+ httpMethod: 'post',
16
+ httpPath: '/v1/compute/volumes/{volume_id}/attach',
17
+ operationId: 'attach_volume',
18
+ };
19
+ exports.tool = {
20
+ name: 'attach_compute_volumes',
21
+ description: "When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nAttach a volume to a VM\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/operation',\n $defs: {\n operation: {\n type: 'object',\n description: 'Operation details.',\n properties: {\n id: {\n type: 'string',\n description: 'Unique identifier for the Operation.'\n },\n created_at: {\n type: 'string',\n description: 'When the Operation was created.',\n format: 'date-time'\n },\n kind: {\n $ref: '#/$defs/operation_kind'\n },\n resource_id: {\n type: 'string',\n description: 'ID of the resource that the Operation is acting on.'\n },\n status: {\n $ref: '#/$defs/operation_status'\n },\n type: {\n $ref: '#/$defs/operation_type'\n },\n updated_at: {\n type: 'string',\n description: 'When the Operation was updated.',\n format: 'date-time'\n }\n },\n required: [ 'id',\n 'created_at',\n 'kind',\n 'resource_id',\n 'status',\n 'type',\n 'updated_at'\n ]\n },\n operation_kind: {\n type: 'string',\n description: 'Kind of Operation.',\n enum: [ 'vm',\n 'volume',\n 'vpc',\n 'firewall_rule'\n ]\n },\n operation_status: {\n type: 'string',\n description: 'Status of the Operation.',\n enum: [ 'pending',\n 'running',\n 'done',\n 'failed',\n 'unknown'\n ]\n },\n operation_type: {\n type: 'string',\n description: 'Type of Operation.',\n enum: [ 'create',\n 'update',\n 'delete',\n 'restart'\n ]\n }\n }\n}\n```",
22
+ inputSchema: {
23
+ type: 'object',
24
+ properties: {
25
+ volume_id: {
26
+ type: 'string',
27
+ },
28
+ vm_id: {
29
+ type: 'string',
30
+ description: 'ID of the VM to attach the Volume to.',
31
+ },
32
+ jq_filter: {
33
+ type: 'string',
34
+ title: 'jq Filter',
35
+ description: 'A jq filter to apply to the response to include certain fields. Consult the output schema in the tool description to see the fields that are available.\n\nFor example: to include only the `name` field in every object of a results array, you can provide ".results[].name".\n\nFor more information, see the [jq documentation](https://jqlang.org/manual/).',
36
+ },
37
+ },
38
+ required: ['volume_id', 'vm_id'],
39
+ },
40
+ annotations: {},
41
+ };
42
+ const handler = async (client, args) => {
43
+ const { volume_id, jq_filter, ...body } = args;
44
+ try {
45
+ return (0, types_1.asTextContentResult)(await (0, filtering_1.maybeFilter)(jq_filter, await client.compute.volumes.attach(volume_id, body)));
46
+ }
47
+ catch (error) {
48
+ if (error instanceof nirvana_1.default.APIError || (0, filtering_1.isJqError)(error)) {
49
+ return (0, types_1.asErrorResult)(error.message);
50
+ }
51
+ throw error;
52
+ }
53
+ };
54
+ exports.handler = handler;
55
+ exports.default = { metadata: exports.metadata, tool: exports.tool, handler: exports.handler };
56
+ //# sourceMappingURL=attach-compute-volumes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attach-compute-volumes.js","sourceRoot":"","sources":["../../../src/tools/compute/volumes/attach-compute-volumes.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;AAEtF,mEAA6E;AAC7E,iEAAqG;AAGrG,oEAAgD;AAEnC,QAAA,QAAQ,GAAa;IAChC,QAAQ,EAAE,iBAAiB;IAC3B,SAAS,EAAE,OAAO;IAClB,IAAI,EAAE,EAAE;IACR,UAAU,EAAE,MAAM;IAClB,QAAQ,EAAE,wCAAwC;IAClD,WAAW,EAAE,eAAe;CAC7B,CAAC;AAEW,QAAA,IAAI,GAAS;IACxB,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EACT,+5DAA+5D;IACj6D,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;aACf;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,uCAAuC;aACrD;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,WAAW;gBAClB,WAAW,EACT,kWAAkW;aACrW;SACF;QACD,QAAQ,EAAE,CAAC,WAAW,EAAE,OAAO,CAAC;KACjC;IACD,WAAW,EAAE,EAAE;CAChB,CAAC;AAEK,MAAM,OAAO,GAAG,KAAK,EAAE,MAAmB,EAAE,IAAyC,EAAE,EAAE;IAC9F,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,IAAW,CAAC;IACtD,IAAI,CAAC;QACH,OAAO,IAAA,2BAAmB,EACxB,MAAM,IAAA,uBAAW,EAAC,SAAS,EAAE,MAAM,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,CACnF,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,iBAAW,CAAC,QAAQ,IAAI,IAAA,qBAAS,EAAC,KAAK,CAAC,EAAE,CAAC;YAC9D,OAAO,IAAA,qBAAa,EAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACtC,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAC;AAZW,QAAA,OAAO,WAYlB;AAEF,kBAAe,EAAE,QAAQ,EAAR,gBAAQ,EAAE,IAAI,EAAJ,YAAI,EAAE,OAAO,EAAP,eAAO,EAAE,CAAC"}
@@ -0,0 +1,49 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { isJqError, maybeFilter } from '@nirvana-labs/nirvana-mcp/filtering';
3
+ import { asErrorResult, asTextContentResult } from '@nirvana-labs/nirvana-mcp/tools/types';
4
+ import NirvanaLabs from '@nirvana-labs/nirvana';
5
+ export const metadata = {
6
+ resource: 'compute.volumes',
7
+ operation: 'write',
8
+ tags: [],
9
+ httpMethod: 'post',
10
+ httpPath: '/v1/compute/volumes/{volume_id}/attach',
11
+ operationId: 'attach_volume',
12
+ };
13
+ export const tool = {
14
+ name: 'attach_compute_volumes',
15
+ description: "When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nAttach a volume to a VM\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/operation',\n $defs: {\n operation: {\n type: 'object',\n description: 'Operation details.',\n properties: {\n id: {\n type: 'string',\n description: 'Unique identifier for the Operation.'\n },\n created_at: {\n type: 'string',\n description: 'When the Operation was created.',\n format: 'date-time'\n },\n kind: {\n $ref: '#/$defs/operation_kind'\n },\n resource_id: {\n type: 'string',\n description: 'ID of the resource that the Operation is acting on.'\n },\n status: {\n $ref: '#/$defs/operation_status'\n },\n type: {\n $ref: '#/$defs/operation_type'\n },\n updated_at: {\n type: 'string',\n description: 'When the Operation was updated.',\n format: 'date-time'\n }\n },\n required: [ 'id',\n 'created_at',\n 'kind',\n 'resource_id',\n 'status',\n 'type',\n 'updated_at'\n ]\n },\n operation_kind: {\n type: 'string',\n description: 'Kind of Operation.',\n enum: [ 'vm',\n 'volume',\n 'vpc',\n 'firewall_rule'\n ]\n },\n operation_status: {\n type: 'string',\n description: 'Status of the Operation.',\n enum: [ 'pending',\n 'running',\n 'done',\n 'failed',\n 'unknown'\n ]\n },\n operation_type: {\n type: 'string',\n description: 'Type of Operation.',\n enum: [ 'create',\n 'update',\n 'delete',\n 'restart'\n ]\n }\n }\n}\n```",
16
+ inputSchema: {
17
+ type: 'object',
18
+ properties: {
19
+ volume_id: {
20
+ type: 'string',
21
+ },
22
+ vm_id: {
23
+ type: 'string',
24
+ description: 'ID of the VM to attach the Volume to.',
25
+ },
26
+ jq_filter: {
27
+ type: 'string',
28
+ title: 'jq Filter',
29
+ description: 'A jq filter to apply to the response to include certain fields. Consult the output schema in the tool description to see the fields that are available.\n\nFor example: to include only the `name` field in every object of a results array, you can provide ".results[].name".\n\nFor more information, see the [jq documentation](https://jqlang.org/manual/).',
30
+ },
31
+ },
32
+ required: ['volume_id', 'vm_id'],
33
+ },
34
+ annotations: {},
35
+ };
36
+ export const handler = async (client, args) => {
37
+ const { volume_id, jq_filter, ...body } = args;
38
+ try {
39
+ return asTextContentResult(await maybeFilter(jq_filter, await client.compute.volumes.attach(volume_id, body)));
40
+ }
41
+ catch (error) {
42
+ if (error instanceof NirvanaLabs.APIError || isJqError(error)) {
43
+ return asErrorResult(error.message);
44
+ }
45
+ throw error;
46
+ }
47
+ };
48
+ export default { metadata, tool, handler };
49
+ //# sourceMappingURL=attach-compute-volumes.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attach-compute-volumes.mjs","sourceRoot":"","sources":["../../../src/tools/compute/volumes/attach-compute-volumes.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,qCAAqC;OACrE,EAAY,aAAa,EAAE,mBAAmB,EAAE,MAAM,uCAAuC;OAG7F,WAAW,MAAM,uBAAuB;AAE/C,MAAM,CAAC,MAAM,QAAQ,GAAa;IAChC,QAAQ,EAAE,iBAAiB;IAC3B,SAAS,EAAE,OAAO;IAClB,IAAI,EAAE,EAAE;IACR,UAAU,EAAE,MAAM;IAClB,QAAQ,EAAE,wCAAwC;IAClD,WAAW,EAAE,eAAe;CAC7B,CAAC;AAEF,MAAM,CAAC,MAAM,IAAI,GAAS;IACxB,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EACT,+5DAA+5D;IACj6D,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;aACf;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,uCAAuC;aACrD;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,WAAW;gBAClB,WAAW,EACT,kWAAkW;aACrW;SACF;QACD,QAAQ,EAAE,CAAC,WAAW,EAAE,OAAO,CAAC;KACjC;IACD,WAAW,EAAE,EAAE;CAChB,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,KAAK,EAAE,MAAmB,EAAE,IAAyC,EAAE,EAAE;IAC9F,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,IAAW,CAAC;IACtD,IAAI,CAAC;QACH,OAAO,mBAAmB,CACxB,MAAM,WAAW,CAAC,SAAS,EAAE,MAAM,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,CACnF,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,WAAW,CAAC,QAAQ,IAAI,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC;YAC9D,OAAO,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACtC,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC"}