Skip to main content
Glama

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
NameRequiredDescriptionDefault
idYesID of the vault to update
nameNoNew name for the vault
descriptionNoNew description for the vault

Implementation Reference

  • 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 }; } };
  • 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'] } },
  • 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 );
  • 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(); }
  • TypeScript interface definition for UpdateVaultArgs used by the handler.
    export interface UpdateVaultArgs { id: string; name?: string; description?: string; }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/disnet/flint-note'

If you have feedback or need assistance with the MCP directory API, please join our Discord server