|
| 1 | +import { z } from "zod"; |
| 2 | + |
| 3 | +// Schema for getting a token |
| 4 | +export const GetTokenSchema = z.object({ |
| 5 | + apiToken: z.string().describe("API token"), |
| 6 | +}); |
| 7 | + |
| 8 | +// Schema for getting all service accounts |
| 9 | +export const GetAllServiceAccountsSchema = z.object({}); |
| 10 | + |
| 11 | +// Schema for creating a service account |
| 12 | +export const CreateServiceAccountSchema = z.object({ |
| 13 | + name: z.string().describe("Service account name"), |
| 14 | +}); |
| 15 | + |
| 16 | +// Schema for deleting a service account |
| 17 | +export const DeleteServiceAccountSchema = z.object({ |
| 18 | + id: z |
| 19 | + .string() |
| 20 | + .describe("Unique identifier (UUID) of the service account to delete"), |
| 21 | +}); |
| 22 | + |
| 23 | +// Tool names |
| 24 | +export const authToolNames = { |
| 25 | + getToken: "get_token", |
| 26 | + getAllServiceAccounts: "get_all_service_accounts", |
| 27 | + createServiceAccount: "create_service_account", |
| 28 | + deleteServiceAccount: "delete_service_account", |
| 29 | +} as const; |
| 30 | + |
| 31 | +// Tool definitions |
| 32 | +export const authToolDefinitions = [ |
| 33 | + { |
| 34 | + name: authToolNames.getToken, |
| 35 | + title: "Get Token", |
| 36 | + description: "Gets an authentication token using an API token.", |
| 37 | + inputSchema: { |
| 38 | + type: "object", |
| 39 | + properties: { |
| 40 | + apiToken: { |
| 41 | + type: "string", |
| 42 | + description: "API token", |
| 43 | + }, |
| 44 | + }, |
| 45 | + required: ["apiToken"], |
| 46 | + }, |
| 47 | + }, |
| 48 | + { |
| 49 | + name: authToolNames.getAllServiceAccounts, |
| 50 | + title: "Get All Service Accounts", |
| 51 | + description: "Retrieves a list of all service accounts.", |
| 52 | + inputSchema: { |
| 53 | + type: "object", |
| 54 | + properties: {}, |
| 55 | + }, |
| 56 | + }, |
| 57 | + { |
| 58 | + name: authToolNames.createServiceAccount, |
| 59 | + title: "Create Service Account", |
| 60 | + description: "Creates a new service account.", |
| 61 | + inputSchema: { |
| 62 | + type: "object", |
| 63 | + properties: { |
| 64 | + name: { |
| 65 | + type: "string", |
| 66 | + description: "Service account name", |
| 67 | + example: "my-service-account", |
| 68 | + }, |
| 69 | + }, |
| 70 | + required: ["name"], |
| 71 | + }, |
| 72 | + }, |
| 73 | + { |
| 74 | + name: authToolNames.deleteServiceAccount, |
| 75 | + title: "Delete Service Account", |
| 76 | + description: |
| 77 | + "Permanently deletes a service account. This action cannot be undone.", |
| 78 | + inputSchema: { |
| 79 | + type: "object", |
| 80 | + properties: { |
| 81 | + id: { |
| 82 | + type: "string", |
| 83 | + description: |
| 84 | + "Unique identifier (UUID) of the service account to delete", |
| 85 | + }, |
| 86 | + }, |
| 87 | + required: ["id"], |
| 88 | + }, |
| 89 | + }, |
| 90 | +]; |
0 commit comments