get_current_vault
Retrieve details about the currently active vault in Flint Note, enabling AI collaboration and organized markdown-based note management.
Instructions
Get information about the currently active vault
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"properties": {},
"required": [],
"type": "object"
}
Implementation Reference
- src/server/vault-handlers.ts:260-305 (handler)The handleGetCurrentVault method that executes the tool's logic: retrieves current vault info from GlobalConfigManager, formats it as rich text content for MCP response, handles no-vault case and errors.handleGetCurrentVault = async (): Promise<{ content: Array<{ type: string; text: string }>; }> => { try { const currentVault = this.globalConfig.getCurrentVault(); if (!currentVault) { return { content: [ { type: 'text', text: '⚠️ No vault is currently selected. Use list_vaults to see available vaults or create_vault to add a new one.' } ] }; } // Find the vault ID const vaults = this.globalConfig.listVaults(); const currentVaultEntry = vaults.find(v => v.is_current); const vaultId = currentVaultEntry?.info.id || 'unknown'; return { content: [ { type: 'text', text: `🟢 **Current Vault**: ${currentVault.name} (${vaultId}) **Path**: ${currentVault.path} **Created**: ${new Date(currentVault.created).toLocaleDateString()} **Last accessed**: ${new Date(currentVault.last_accessed).toLocaleDateString()}${currentVault.description ? `\n**Description**: ${currentVault.description}` : ''}` } ] }; } catch (error) { const errorMessage = error instanceof Error ? error.message : 'Unknown error'; return { content: [ { type: 'text', text: `Failed to get current vault: ${errorMessage}` } ] }; } };
- src/server/tool-schemas.ts:629-637 (schema)Input schema definition for the get_current_vault tool: no required parameters.{ name: 'get_current_vault', description: 'Get information about the currently active vault', inputSchema: { type: 'object', properties: {}, required: [] } },
- src/server.ts:1289-1290 (registration)MCP tool registration in CallToolRequestSchema handler: maps 'get_current_vault' calls to vaultHandlers.handleGetCurrentVault()case 'get_current_vault': return await this.vaultHandlers.handleGetCurrentVault();
- src/utils/global-config.ts:357-363 (helper)GlobalConfigManager.getCurrentVault(): Returns VaultInfo for the current vault ID from loaded config or null if none set. Core utility used by the tool handler.getCurrentVault(): VaultInfo | null { if (!this.#config || !this.#config.current_vault) { return null; } return this.#config.vaults[this.#config.current_vault] || null; }