Skip to main content
Glama
quinny1187

Obsidian MCP Server

by quinny1187

get_vault_info

Retrieve details about an Obsidian vault, including its structure and metadata, by providing the vault's file path.

Instructions

Get information about a specific vault

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
vault_pathYesPath to the Obsidian vault

Implementation Reference

  • The main handler function that executes the tool logic: fetches vault stats from VaultManager and returns formatted information including note count, size, etc.
    export async function handleGetVaultInfo(
      vaultManager: VaultManager,
      vaultPath: string
    ) {
      const stats = await vaultManager.getVaultStats(vaultPath);
      
      return {
        path: stats.path,
        name: stats.name,
        noteCount: stats.noteCount,
        totalSize: stats.size,
        lastModified: stats.lastModified,
        sizeFormatted: formatBytes(stats.size || 0),
      };
    }
  • Input schema defining the required 'vault_path' parameter for the tool.
    inputSchema: {
      type: 'object',
      properties: {
        vault_path: {
          type: 'string',
          description: 'Path to the Obsidian vault',
        },
      },
      required: ['vault_path'],
    },
  • src/index.ts:44-57 (registration)
    Tool definition registered in the TOOLS array for the list_tools MCP request.
    {
      name: 'get_vault_info',
      description: 'Get information about a specific vault',
      inputSchema: {
        type: 'object',
        properties: {
          vault_path: {
            type: 'string',
            description: 'Path to the Obsidian vault',
          },
        },
        required: ['vault_path'],
      },
    },
  • src/index.ts:176-181 (registration)
    Dispatch logic in the call_tool handler that invokes the get_vault_info tool implementation.
    case 'get_vault_info':
      if (!args || typeof args !== 'object' || !('vault_path' in args)) {
        throw new McpError(ErrorCode.InvalidParams, 'Missing vault_path');
      }
      result = await handleGetVaultInfo(vaultManager, args.vault_path as string);
      break;
  • Helper function used by the handler to format the total size of the vault into human-readable bytes.
    function formatBytes(bytes: number): string {
      if (bytes === 0) return '0 Bytes';
      
      const k = 1024;
      const sizes = ['Bytes', 'KB', 'MB', 'GB'];
      const i = Math.floor(Math.log(bytes) / Math.log(k));
      
      return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool retrieves information, implying a read-only operation, but doesn't specify what 'information' includes (e.g., metadata, settings, statistics), whether it requires authentication, or any rate limits. This leaves significant gaps in understanding the tool's behavior beyond basic retrieval.

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 waste. It's appropriately sized for a simple tool, front-loaded with the core purpose, and doesn't include unnecessary details, making it highly concise and well-structured.

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?

Given the complexity of a tool that retrieves information without an output schema, the description is incomplete. It doesn't explain what 'information' entails (e.g., JSON structure, key fields), leaving the agent uncertain about return values. With no annotations and low behavioral transparency, this gap makes the description inadequate for effective tool use.

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?

The input schema has 100% description coverage, with 'vault_path' clearly documented as 'Path to the Obsidian vault'. The description adds no additional meaning beyond this, such as format examples or constraints, so it meets the baseline of 3 where the schema does the heavy lifting without extra value from the description.

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

Purpose3/5

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

The description 'Get information about a specific vault' clearly states the action (get) and resource (vault), but it's vague about what information is retrieved. It distinguishes from siblings like 'list_vaults' (which lists multiple vaults) and 'list_notes' (which lists notes), but doesn't specify what details are included versus excluded, such as metadata or configuration.

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. It doesn't mention prerequisites (e.g., needing an existing vault), exclusions (e.g., not for modifying vaults), or comparisons to siblings like 'list_vaults' (for overviews) or 'search_vault' (for content within vaults), leaving usage context unclear.

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/quinny1187/obsidian-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server