Reset Active Vault Selection
vault.resetClear the session-selected vault to revert to the default OBSIDIAN_VAULT_PATH. Use when done with a scratch vault to restore the default vault path.
Instructions
Clear the session-selected vault so the precedence chain falls back to OBSIDIAN_VAULT_PATH. Use this to signal 'I'm done with the scratch vault, go back to the default'. Idempotent — running on an already-cleared session is a no-op that reports changed: false. Does not change per-call vaultPath behaviour.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| changed | Yes | ||
| target | Yes | ||
| summary | Yes | ||
| previous | Yes |
Implementation Reference
- src/server/tools/vaults.ts:166-178 (handler)The handler function for vault.reset. It parses args (none), reads the current active vault from context.session.activeVault, sets it to null, and returns whether the state changed, the target vault path, a summary message, and the previous vault record.
handler: async (context, rawArgs) => { vaultResetArgsSchema.parse(rawArgs) as VaultResetArgs; const previous = context.session.activeVault; context.session.activeVault = null; return { changed: previous !== null, target: context.env.OBSIDIAN_VAULT_PATH ?? "", summary: previous ? `Active vault selection cleared (was "${previous.name}")` : "No active vault selection to clear", previous, }; }, - src/schema/vaults.ts:163-167 (schema)Input schema for vault.reset: an empty object (no arguments required).
export const vaultResetArgsSchema = z .object({}) .strict() .describe("Arguments for `vault.reset` (none)."); export type VaultResetArgs = z.input<typeof vaultResetArgsSchema>; - src/schema/vaults.ts:169-176 (schema)Output schema for vault.reset: returns changed (boolean), target (string), summary (string), and previous (nullable vault record).
export const vaultResetOutputSchema = z .object({ changed: z.boolean(), target: z.string(), summary: z.string(), previous: vaultRecordSchema.nullable(), }) .describe("Return shape of `vault.reset`."); - src/server/tools/vaults.ts:14-18 (registration)vault.reset is registered as a ToolDefinition in the vaultTools array exported from src/server/tools/vaults.ts. The array is imported into the central tool registry at src/server/registry.ts.
vaultResetArgsSchema, vaultResetOutputSchema, vaultSelectArgsSchema, vaultSelectOutputSchema, } from "../../schema/vaults.js"; - src/server/registry.ts:15-19 (registration)The vaultTools array (containing vault.reset) is imported and spread into the central toolRegistry at src/server/registry.ts.
import { vaultTools } from "./tools/vaults.js"; import { wikiTools } from "./tools/wiki.js"; export const toolRegistry: ToolDefinition[] = [ ...vaultTools,