diff --git a/src/tools/index.ts b/src/tools/index.ts index dc2ad99..e4305c6 100644 --- a/src/tools/index.ts +++ b/src/tools/index.ts @@ -577,7 +577,7 @@ export class ToolRegistry { break; } case "get_vault_info": - result = await this.vaultTools.getVaultInfo(); + result = this.vaultTools.getVaultInfo(); break; case "list": { const a = args as { path?: string; recursive?: boolean; includes?: string[]; excludes?: string[]; only?: 'files' | 'directories' | 'any'; limit?: number; cursor?: string; withFrontmatterSummary?: boolean; includeWordCount?: boolean }; @@ -601,7 +601,7 @@ export class ToolRegistry { } case "exists": { const a = args as { path: string }; - result = await this.vaultTools.exists(a.path); + result = this.vaultTools.exists(a.path); break; } case "read_excalidraw": { @@ -629,7 +629,7 @@ export class ToolRegistry { } case "resolve_wikilink": { const a = args as { sourcePath: string; linkText: string }; - result = await this.vaultTools.resolveWikilink(a.sourcePath, a.linkText); + result = this.vaultTools.resolveWikilink(a.sourcePath, a.linkText); break; } case "backlinks": { diff --git a/src/tools/vault-tools.ts b/src/tools/vault-tools.ts index b248b91..98333d1 100644 --- a/src/tools/vault-tools.ts +++ b/src/tools/vault-tools.ts @@ -15,7 +15,7 @@ export class VaultTools { private metadata: IMetadataCacheAdapter ) {} - async getVaultInfo(): Promise { + getVaultInfo(): CallToolResult { try { const allFiles = this.vault.getMarkdownFiles(); const totalNotes = allFiles.length; @@ -60,7 +60,7 @@ export class VaultTools { return Math.round((bytes / Math.pow(k, i)) * 100) / 100 + ' ' + sizes[i]; } - async listNotes(path?: string): Promise { + listNotes(path?: string): CallToolResult { let items: Array = []; // Normalize root path: undefined, empty string "", or "." all mean root @@ -279,7 +279,7 @@ export class VaultTools { // Apply type filtering and add items if (item instanceof TFile) { if (only !== 'directories') { - const fileMetadata = await this.createFileMetadataWithFrontmatter(item, withFrontmatterSummary || false); + const fileMetadata = this.createFileMetadataWithFrontmatter(item, withFrontmatterSummary || false); // Optionally include word count (best effort) if (includeWordCount) { @@ -307,10 +307,10 @@ export class VaultTools { } } - private async createFileMetadataWithFrontmatter( + private createFileMetadataWithFrontmatter( file: TFile, withFrontmatterSummary: boolean - ): Promise { + ): FileMetadataWithFrontmatter { const baseMetadata = this.createFileMetadata(file); if (!withFrontmatterSummary || file.extension !== 'md') { @@ -495,7 +495,7 @@ export class VaultTools { }; } - async exists(path: string): Promise { + exists(path: string): CallToolResult { // Validate path if (!PathUtils.isValidVaultPath(path)) { return { @@ -922,7 +922,7 @@ export class VaultTools { * Resolve a single wikilink from a source note * Returns the target path if resolvable, or suggestions if not */ - async resolveWikilink(sourcePath: string, linkText: string): Promise { + resolveWikilink(sourcePath: string, linkText: string): CallToolResult { try { // Normalize and validate source path const normalizedPath = PathUtils.normalizePath(sourcePath);