Skip to main content
Glama

get_current_vault

Retrieve details about the currently active note vault to understand the working context and access organized markdown files.

Instructions

Get information about the currently active vault

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the 'get_current_vault' tool. It retrieves the current vault information from GlobalConfigManager, formats it nicely, and returns it as a text response. Handles the case where no vault is selected.
    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}` } ] }; } };
  • The input schema definition for the 'get_current_vault' tool, specifying no required parameters.
    name: 'get_current_vault', description: 'Get information about the currently active vault', inputSchema: { type: 'object', properties: {}, required: [] } },
  • Registration of the tool handler in the main MCP server's CallToolRequestSchema switch statement, dispatching calls to 'get_current_vault' to the VaultHandlers.handleGetCurrentVault method.
    case 'get_current_vault': return await this.vaultHandlers.handleGetCurrentVault(); case 'update_vault':
  • Core helper method in GlobalConfigManager that retrieves the current vault information from the configuration, 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; }

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