Skip to main content
Glama
disnet
by disnet

create_vault

Create a new vault in Flint Note to organize markdown notes for AI collaboration by specifying a unique ID, name, and directory path.

Instructions

Create a new vault and add it to the vault registry

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesUnique identifier for the vault (filesystem-safe)
nameYesHuman-readable name for the vault
pathYesDirectory path where the vault should be created
descriptionNoOptional description of the vault purpose
initializeNoWhether to initialize with default note types
switch_toNoWhether to switch to the new vault after creation

Implementation Reference

  • The core handler function that executes the create_vault tool. Validates input, creates directory, registers vault, optionally initializes with default note types and switches to it.
    handleCreateVault = async (
      args: CreateVaultArgs
    ): Promise<{ content: Array<{ type: string; text: string }>; isError?: boolean }> => {
      try {
        // Validate arguments
        validateToolArgs('create_vault', args);
        // Validate vault ID
        if (!this.globalConfig.isValidVaultId(args.id)) {
          throw new Error(
            `Invalid vault ID '${args.id}'. Must contain only letters, numbers, hyphens, and underscores.`
          );
        }
    
        // Check if vault already exists
        if (this.globalConfig.hasVault(args.id)) {
          throw new Error(`Vault with ID '${args.id}' already exists`);
        }
    
        // Resolve path with tilde expansion
        const resolvedPath = resolvePath(args.path);
    
        // Validate path safety
        if (!isPathSafe(args.path)) {
          throw new Error(`Invalid or unsafe path: ${args.path}`);
        }
    
        // Ensure directory exists
        await fs.mkdir(resolvedPath, { recursive: true });
    
        // Add vault to registry
        await this.globalConfig.addVault(
          args.id,
          args.name,
          resolvedPath,
          args.description
        );
    
        let initMessage = '';
        if (args.initialize !== false) {
          // Initialize the vault with default note types
          const tempHybridSearchManager = new HybridSearchManager(resolvedPath);
          const workspace = new Workspace(
            resolvedPath,
            tempHybridSearchManager.getDatabaseManager()
          );
          await workspace.initializeVault();
          initMessage =
            '\n\nāœ… Vault initialized with default note types (daily, reading, todos, projects, goals, games, movies)';
        }
    
        let switchMessage = '';
        if (args.switch_to !== false) {
          // Switch to the new vault
          await this.globalConfig.switchVault(args.id);
    
          // Reinitialize server with new vault
          await this.initializeServer();
    
          switchMessage = '\n\nšŸ”„ Switched to new vault';
        }
    
        return {
          content: [
            {
              type: 'text',
              text: `āœ… Created vault '${args.name}' (${args.id}) at: ${resolvedPath}${initMessage}${switchMessage}`
            }
          ]
        };
      } catch (error) {
        const errorMessage = error instanceof Error ? error.message : 'Unknown error';
        return {
          content: [
            {
              type: 'text',
              text: `Failed to create vault: ${errorMessage}`
            }
          ],
          isError: true
        };
      }
  • Registers the vault-handlers.handleCreateVault method as the handler for the 'create_vault' tool call in the MCP server.
        args as unknown as CreateVaultArgs
      );
    case 'switch_vault':
      return await this.vaultHandlers.handleSwitchVault(
  • JSON Schema defining the input parameters for the create_vault tool.
    {
      name: 'create_vault',
      description: 'Create a new vault with specified configuration',
      inputSchema: {
        type: 'object',
        properties: {
          id: {
            type: 'string',
            description:
              'Unique identifier for the vault (letters, numbers, hyphens, underscores only)'
          },
          name: {
            type: 'string',
            description: 'Human-readable name for the vault'
          },
          path: {
            type: 'string',
            description: 'File system path where the vault will be stored'
          },
          description: {
            type: 'string',
            description: 'Optional description of the vault purpose'
          },
          initialize: {
            type: 'boolean',
            description: 'Whether to initialize the vault with default note types',
            default: true
          },
          switch_to: {
            type: 'boolean',
            description: 'Whether to switch to this vault after creation',
            default: true
          }
        },
        required: ['id', 'name', 'path']
      }
    },
  • TypeScript interface for CreateVaultArgs used in handler and registration.
    export interface CreateVaultArgs {
      id: string;
      name: string;
      path: string;
      description?: string;
      initialize?: boolean;
      switch_to?: boolean;
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. While 'Create' implies a write operation, it doesn't specify permissions needed, whether the operation is idempotent, what happens if the vault already exists, or error conditions. It mentions adding to a registry but doesn't explain what that entails or the response format.

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 front-loaded with the core action and outcome, making it easy to parse quickly. Every part of the sentence contributes essential information.

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?

For a creation tool with no annotations and no output schema, the description is minimally adequate but lacks completeness. It doesn't address behavioral aspects like error handling, side effects, or what 'add it to the vault registry' means in practice. Given the complexity of creating a vault with 6 parameters, more context would be helpful.

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 fully documents all 6 parameters. The description adds no additional meaning beyond what's in the schema (e.g., it doesn't clarify relationships between parameters like 'id' and 'path'). Baseline 3 is appropriate as the schema handles parameter documentation adequately.

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

Purpose5/5

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

The description clearly states the specific action ('Create a new vault') and the outcome ('add it to the vault registry'), distinguishing it from sibling tools like 'list_vaults', 'remove_vault', or 'update_vault'. It uses precise verbs and identifies the resource being created.

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. It doesn't mention prerequisites (e.g., whether a vault registry must exist), when not to use it, or how it relates to sibling tools like 'switch_vault' or 'remove_vault'. Usage is implied but not explicitly defined.

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