vault_write
Store secrets securely in HashiCorp Vault by writing data to specified paths using JSON format for sensitive information management.
Instructions
Write a secret to Vault at the specified path
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | The path to write the secret to (e.g., 'secret/data/myapp') | |
| data | Yes | The secret data to write as a JSON object |
Implementation Reference
- src/index.ts:132-144 (handler)Handler for the vault_write tool: extracts path and data from arguments, wraps data for KV v2, writes to Vault using vaultClient.write, and returns the result as formatted JSON text content.case "vault_write": { const { path, data } = args as { path: string; data: Record<string, any> }; // For KV v2, wrap data in a data object const result = await vaultClient.write(path, { data }); return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; }
- src/index.ts:45-62 (registration)Registration of the vault_write tool in the TOOLS array used for ListToolsRequest, defining name, description, and inputSchema requiring 'path' (string) and 'data' (object).{ name: "vault_write", description: "Write a secret to Vault at the specified path", inputSchema: { type: "object", properties: { path: { type: "string", description: "The path to write the secret to (e.g., 'secret/data/myapp')", }, data: { type: "object", description: "The secret data to write as a JSON object", }, }, required: ["path", "data"], }, },