update_vault
Modify vault details like name or description in Flint Note's AI-collaborative note-taking system to keep your organized markdown files current.
Instructions
Update vault information (name or description)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ID of the vault to update | |
| name | No | New name for the vault | |
| description | No | New description for the vault |
Implementation Reference
- src/server/vault-handlers.ts:310-357 (handler)The main handler function for the 'update_vault' MCP tool. Validates input arguments using validateToolArgs('update_vault'), checks if vault exists, constructs updates object, calls globalConfig.updateVault, 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/tool-schemas.ts:639-659 (schema)The input schema definition for the 'update_vault' tool, defining required 'id' and optional 'name' and 'description' fields.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.ts:1291-1294 (registration)Registration of the 'update_vault' tool in the MCP server's CallToolRequestSchema handler switch statement, mapping the tool name to the vaultHandlers.handleUpdateVault method.case 'update_vault': return await this.vaultHandlers.handleUpdateVault( args as unknown as UpdateVaultArgs );
- src/utils/global-config.ts:402-423 (helper)Core helper function in GlobalConfigManager that performs the actual vault metadata update by modifying the in-memory config and persisting to YAML file.async updateVault( id: string, updates: Partial<Pick<VaultInfo, 'name' | 'description'>> ): Promise<void> { if (!this.#config) { await this.load(); } if (!this.#config!.vaults[id]) { throw new Error(`Vault with ID '${id}' does not exist`); } if (updates.name) { this.#config!.vaults[id].name = updates.name; } if (updates.description !== undefined) { this.#config!.vaults[id].description = updates.description; } await this.save(); }
- src/server/types.ts:148-152 (schema)TypeScript interface definition for UpdateVaultArgs used by the handler.export interface UpdateVaultArgs { id: string; name?: string; description?: string; }