update_vault
Modify vault details in Flint Note by updating its name or description using the vault’s unique ID, ensuring your note organization stays current.
Instructions
Update vault information (name or description)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| description | No | New description for the vault | |
| id | Yes | ID of the vault to update | |
| name | No | New name for the vault |
Input Schema (JSON Schema)
{
"properties": {
"description": {
"description": "New description for the vault",
"type": "string"
},
"id": {
"description": "ID of the vault to update",
"type": "string"
},
"name": {
"description": "New name for the vault",
"type": "string"
}
},
"required": [
"id"
],
"type": "object"
}
Implementation Reference
- src/server/vault-handlers.ts:310-357 (handler)The primary handler function for the 'update_vault' MCP tool. Validates input arguments, checks if the vault exists, constructs updates for name and/or description, persists changes via GlobalConfigManager, and returns a formatted success or error response.handleUpdateVault = async ( args: UpdateVaultArgs ): Promise<{ content: Array<{ type: string; text: string }>; isError?: boolean }> => { try { // Validate arguments validateToolArgs('update_vault', args); const vault = this.globalConfig.getVault(args.id); if (!vault) { throw new Error(`Vault with ID '${args.id}' does not exist`); } const updates: Partial<Pick<typeof vault, 'name' | 'description'>> = {}; if (args.name) updates.name = args.name; if (args.description !== undefined) updates.description = args.description; if (Object.keys(updates).length === 0) { throw new Error( 'No updates provided. Specify name and/or description to update.' ); } await this.globalConfig.updateVault(args.id, updates); const updatedVault = this.globalConfig.getVault(args.id)!; return { content: [ { type: 'text', text: `✅ Updated vault '${args.id}': **Name**: ${updatedVault.name} **Description**: ${updatedVault.description || 'None'} **Path**: ${updatedVault.path}` } ] }; } catch (error) { const errorMessage = error instanceof Error ? error.message : 'Unknown error'; return { content: [ { type: 'text', text: `Failed to update vault: ${errorMessage}` } ], isError: true }; } };
- src/server.ts:1291-1294 (registration)MCP tool call dispatcher registration that routes 'update_vault' tool invocations to the VaultHandlers.handleUpdateVault method.case 'update_vault': return await this.vaultHandlers.handleUpdateVault( args as unknown as UpdateVaultArgs );
- src/server/tool-schemas.ts:638-659 (schema)JSON schema definition for the 'update_vault' tool input parameters, defining the expected structure (id required, name and description optional). This schema is used for tool discovery and validation.{ name: 'update_vault', description: 'Update vault metadata (name and/or description)', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'ID of the vault to update' }, name: { type: 'string', description: 'New name for the vault' }, description: { type: 'string', description: 'New description for the vault' } }, required: ['id'] } },
- src/server/types.ts:148-152 (schema)TypeScript interface defining the shape of arguments accepted by the update_vault handler.export interface UpdateVaultArgs { id: string; name?: string; description?: string; }
- src/server/validation.ts:702-721 (helper)Runtime validation rules for 'update_vault' tool arguments, ensuring id is provided and non-empty, with optional name and description fields.update_vault: [ { field: 'id', required: true, type: 'string', allowEmpty: false }, { field: 'name', required: false, type: 'string', allowEmpty: false }, { field: 'description', required: false, type: 'string', allowEmpty: true } ],