Skip to main content
Glama
disnet
by disnet

switch_vault

Change to a different vault in Flint Note to manage markdown files with semantic note types for AI collaboration.

Instructions

Switch to a different vault

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesID of the vault to switch to

Implementation Reference

  • The core handler function for the 'switch_vault' tool. Validates arguments, checks if vault exists, switches the current vault using GlobalConfigManager, reinitializes the server workspace, and returns a formatted success or error message.
    handleSwitchVault = async (
      args: SwitchVaultArgs
    ): Promise<{ content: Array<{ type: string; text: string }>; isError?: boolean }> => {
      try {
        // Validate arguments
        validateToolArgs('switch_vault', args);
        const vault = this.globalConfig.getVault(args.id);
        if (!vault) {
          throw new Error(`Vault with ID '${args.id}' does not exist`);
        }
    
        // Switch to the vault
        await this.globalConfig.switchVault(args.id);
    
        // Reinitialize server with new vault
        await this.initializeServer();
    
        return {
          content: [
            {
              type: 'text',
              text: `🔄 Switched to vault: ${vault.name} (${args.id})\nPath: ${vault.path}`
            }
          ]
        };
      } catch (error) {
        const errorMessage = error instanceof Error ? error.message : 'Unknown error';
        return {
          content: [
            {
              type: 'text',
              text: `Failed to switch vault: ${errorMessage}`
            }
          ],
          isError: true
        };
      }
    };
  • MCP tool registration in the CallToolRequestSchema handler. Dispatches 'switch_vault' calls to the VaultHandlers.handleSwitchVault method.
      );
    case 'remove_vault':
      return await this.vaultHandlers.handleRemoveVault(
        args as unknown as RemoveVaultArgs
  • TypeScript interface defining the input arguments for the switch_vault tool.
    export interface SwitchVaultArgs {
      id: string;
    }
  • JSON Schema definition for the switch_vault tool input, used for MCP tool listing and validation.
      name: 'switch_vault',
      description: 'Switch to a different vault',
      inputSchema: {
        type: 'object',
        properties: {
          id: {
            type: 'string',
            description: 'ID of the vault to switch to'
          }
        },
        required: ['id']
      }
    },
  • Runtime validation rules for switch_vault tool arguments.
    switch_vault: [
      {
        field: 'id',
        required: true,
        type: 'string',
        allowEmpty: false
      }
    ],
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. 'Switch to' implies a state change operation, but the description doesn't reveal whether this affects subsequent operations, requires specific permissions, or has any side effects. It's minimal for a mutation tool.

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 with zero wasted words. It's appropriately sized for a simple operation and front-loads the core purpose immediately.

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

Completeness2/5

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

For a state-changing tool with no annotations and no output schema, the description is insufficient. It doesn't explain what 'switching' entails operationally, what happens after switching, or how this interacts with other tools in the vault management context.

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 single 'id' parameter fully. The description adds no additional parameter context beyond what's in the schema, meeting the baseline for high coverage.

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 ('switch to') and resource ('vault'), making the purpose immediately understandable. It doesn't differentiate from siblings like 'get_current_vault' or 'list_vaults', but the verb 'switch' implies changing state rather than retrieving information.

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?

The description provides no guidance on when to use this tool versus alternatives like 'get_current_vault' or 'list_vaults'. There's no mention of prerequisites (e.g., needing to know vault IDs from 'list_vaults') or consequences of switching vaults.

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