list_vaults
View all configured vaults, their status, and relevant details to manage note organization efficiently on the Flint Note MCP server.
Instructions
List all configured vaults with their status and information
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"properties": {},
"required": [],
"type": "object"
}
Implementation Reference
- src/server/vault-handlers.ts:30-73 (handler)The main handler function that executes the logic for the 'list_vaults' MCP tool. It retrieves vaults from global config, formats them nicely, and returns as MCP content.handleListVaults = async (): Promise<{ content: Array<{ type: string; text: string }>; }> => { try { const vaults = this.globalConfig.listVaults(); if (vaults.length === 0) { return { content: [ { type: 'text', text: 'No vaults configured. Use create_vault to add your first vault.' } ] }; } const vaultList = vaults .map(({ info, is_current }) => { const indicator = is_current ? '🟢 (current)' : '⚪'; return `${indicator} **${info.id}**: ${info.name}\n Path: ${info.path}\n Created: ${new Date(info.created).toLocaleDateString()}\n Last accessed: ${new Date(info.last_accessed).toLocaleDateString()}${info.description ? `\n Description: ${info.description}` : ''}`; }) .join('\n\n'); return { content: [ { type: 'text', text: `📁 **Configured Vaults**\n\n${vaultList}` } ] }; } catch (error) { const errorMessage = error instanceof Error ? error.message : 'Unknown error'; return { content: [ { type: 'text', text: `Failed to list vaults: ${errorMessage}` } ] }; } };
- src/server/tool-schemas.ts:556-562 (schema)The input schema definition for the 'list_vaults' tool, specifying no required parameters.name: 'list_vaults', description: 'List all configured vaults', inputSchema: { type: 'object', properties: {}, required: [] }
- src/server.ts:1275-1277 (registration)Registration of the 'list_vaults' tool in the MCP server's CallToolRequestSchema handler switch statement, mapping it to the vaultHandlers.handleListVaults method.case 'list_vaults': return await this.vaultHandlers.handleListVaults(); case 'create_vault':
- src/utils/global-config.ts:376-386 (helper)Helper method in GlobalConfigManager that lists all vaults from the configuration, marking the current one.listVaults(): Array<{ info: VaultInfo; is_current: boolean }> { if (!this.#config) { return []; } return Object.entries(this.#config.vaults).map(([id, info]) => ({ id, info, is_current: id === this.#config!.current_vault })); }