Skip to main content
Glama
disnet
by disnet

remove_vault

Remove a vault from the Flint Note registry while preserving the underlying files. Use this tool to unregister vaults without deleting your note data.

Instructions

Remove a vault from the registry (does not delete files)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesID of the vault to remove

Implementation Reference

  • The handler function that executes the remove_vault tool logic: validates input, checks vault existence, removes from global config, handles current vault reinitialization if necessary, and formats response.
    /**
     * Removes a vault from the registry (does not delete files)
     */
    handleRemoveVault = async (
      args: RemoveVaultArgs
    ): Promise<{ content: Array<{ type: string; text: string }>; isError?: boolean }> => {
      try {
        // Validate arguments
        validateToolArgs('remove_vault', args);
        const vault = this.globalConfig.getVault(args.id);
        if (!vault) {
          throw new Error(`Vault with ID '${args.id}' does not exist`);
        }
    
        const wasCurrentVault = this.globalConfig.getCurrentVault()?.path === vault.path;
    
        // Remove vault from registry
        await this.globalConfig.removeVault(args.id);
    
        let switchMessage = '';
        if (wasCurrentVault) {
          // Reinitialize server if we removed the current vault
          await this.initializeServer();
          const newCurrent = this.globalConfig.getCurrentVault();
          if (newCurrent) {
            switchMessage = `\n\n🔄 Switched to vault: ${newCurrent.name}`;
          } else {
            switchMessage =
              '\n\n⚠️  No vaults remaining. You may want to create a new vault.';
          }
        }
    
        return {
          content: [
            {
              type: 'text',
              text: `✅ Removed vault '${vault.name}' (${args.id}) from registry.\n\n⚠️  Note: Vault files at '${vault.path}' were not deleted.${switchMessage}`
            }
          ]
        };
      } catch (error) {
        const errorMessage = error instanceof Error ? error.message : 'Unknown error';
        return {
          content: [
            {
              type: 'text',
              text: `Failed to remove vault: ${errorMessage}`
            }
          ],
          isError: true
        };
      }
    };
  • Registration of the remove_vault tool handler in the MCP server's CallToolRequestSchema switch statement.
    case 'remove_vault':
      return await this.vaultHandlers.handleRemoveVault(
        args as unknown as RemoveVaultArgs
      );
    case 'get_current_vault':
      return await this.vaultHandlers.handleGetCurrentVault();
    case 'update_vault':
      return await this.vaultHandlers.handleUpdateVault(
        args as unknown as UpdateVaultArgs
      );
  • The input schema definition for the remove_vault tool.
      name: 'remove_vault',
      description: 'Remove a vault from the registry (does not delete files)',
      inputSchema: {
        type: 'object',
        properties: {
          id: {
            type: 'string',
            description: 'ID of the vault to remove'
          }
        },
        required: ['id']
      }
    },
  • Core helper method that performs the actual vault removal from the global configuration file by deleting the entry and adjusting current_vault if necessary.
    async removeVault(id: string): Promise<void> {
      if (!this.#config) {
        await this.load();
      }
    
      if (!this.#config!.vaults[id]) {
        throw new Error(`Vault with ID '${id}' does not exist`);
      }
    
      delete this.#config!.vaults[id];
    
      // Clear current vault if it was the one being removed
      if (this.#config!.current_vault === id) {
        // Set to the first available vault, or null if no vaults left
        const remainingVaults = Object.keys(this.#config!.vaults);
        this.#config!.current_vault =
          remainingVaults.length > 0 ? remainingVaults[0] : null;
      }
    
      await this.save();
    }
  • TypeScript interface defining the input arguments for remove_vault.
    export interface RemoveVaultArgs {
      id: string;
    }
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden. It discloses that removal is from the registry and does not delete files, which is useful behavioral context. However, it lacks details on permissions needed, whether the action is reversible, error conditions, or what happens to associated notes/vault data.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core action and clarifies a key behavioral point (no file deletion). There is no wasted text, making it appropriately concise for a simple tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description is minimally complete for a destructive operation—it states the action and a critical constraint (files not deleted). However, it lacks details on side effects, success indicators, or error handling, which are important for a mutation tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents the 'id' parameter fully. The description adds no additional meaning about the parameter, such as format examples or where to find the ID, but doesn't need to compensate for gaps.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Remove') and resource ('a vault from the registry'), distinguishing it from siblings like 'delete_note' or 'delete_note_type' which handle different resources. However, it doesn't specify what 'registry' refers to or differentiate from 'bulk_delete_notes' in scope.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'delete_vault' (if existed) or 'bulk_delete_notes', nor prerequisites such as needing the vault to be empty or inactive. The description implies it's for removal from a registry, but doesn't clarify context or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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