Fixed parameter quoting in file operations and search tools to handle
filenames and values containing spaces correctly.
Root Cause:
- Obsidian CLI requires quoting values with spaces: name="My Note"
- Previous implementation used unquoted format: name=My Note
- Shell would split on spaces, breaking multi-word filenames
Solution:
1. Created formatParam() helper in src/utils/cli-helpers.ts
- Always quotes parameter values: param="value"
- Handles spaces and special characters safely
2. Updated file-operations.ts (8 tools):
- All file/path/content/name parameters now quoted
- create, read, append, prepend, delete, move, rename, open
3. Updated search.ts (1 tool):
- query, path, format, limit parameters now quoted
- Fixes searches with multi-word queries
Changes:
- Before: cmdArgs.push(\`file=${name}\`)
- After: cmdArgs.push(formatParam('file', name))
Files changed:
- src/utils/cli-helpers.ts (new): formatParam() and buildCmdArgs() helpers
- src/tools/file-operations.ts: Use formatParam() for all parameters
- src/tools/search.ts: Use formatParam() for all parameters
Impact:
- File operations now work with multi-word filenames
- Search queries with spaces now work correctly
- Content parameters with newlines/special chars handled safely
Known Issue:
- links.ts, tags-aliases.ts, properties.ts still need similar fixes
- These tools have additional structural issues (wrong command names)
- Will be addressed in follow-up commit
Build: 0 errors
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Created SCOPE.md to clearly document project scope changes and
provide a single source of truth for what's in/out of scope.
Contents:
- Current scope (US1-US3 with tool lists)
- Removed scope (US4-US5 with rationale)
- Impact summary (before/after comparison)
- Implementation status table
- Next steps roadmap
Benefits:
- Clear reference for scope discussions
- Tracks removed features for potential future work
- Documents decision rationale
- Provides implementation progress snapshot
File: specs/001-obsidian-mcp-bundle/SCOPE.md
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Added complete inputSchema definition for the obsidian_search tool
with all parameters matching the Obsidian CLI specification:
Parameters (per 'obsidian search help'):
- query (string, required): Search query text
- path (string, optional): Limit search to folder path
- limit (number, optional): Maximum number of results
- total (boolean, optional): Return match count instead of files
- case (boolean, optional): Case sensitive search
- format (enum, optional): Output format (text|json, default: text)
The inputSchema is now properly exposed via tools/list, enabling:
- Better parameter documentation in MCP clients
- Automatic parameter validation
- Type hints in Claude Desktop
- Improved developer experience
Previously the schema was empty { properties: {} }, now it fully
documents all available parameters with types and descriptions.
Files changed:
- src/tools/search.ts: Added complete inputSchema definition
Build: ✅ 0 errors
Validation: ✅ Manifest passes
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Issue: The registerTool method was receiving description and inputSchema
parameters but marking them as unused (_description, _inputSchema) and
not storing them with the handler. This caused tools/list to return
tools without their description and inputSchema properties.
Fix: Remove underscore prefixes and explicitly set these properties on
the handler object before storing it in the tools Map.
Now tools/list will properly return:
- name: Tool name
- description: Tool description (from registerTool call)
- inputSchema: Tool input schema (from registerTool call)
This ensures MCP clients can see proper tool documentation and schemas.
Files changed:
- src/server.ts: Fixed registerTool to preserve metadata
Build: ✅ 0 errors
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Removed obsidian_search_with_context tool (not in CLI spec)
Updated obsidian_search to use exact CLI parameter names:
- query (required) - Search query text
- path (optional) - Limit search to folder path
- limit (optional) - Max number of files to return
- total (optional) - Return match count instead of file list
- case (optional) - Case sensitive search
- format (optional) - Output format: text or json (default: text)
Changed parameter names to match CLI:
- folder → path
- caseSensitive → case
- Added: total flag for match counts
- Removed: contextLines (not in CLI)
Files updated:
- src/tools/search.ts: Simplified to single search tool
- src/validation/schemas.ts: Updated searchSchema parameters
- manifest.json: Removed search_with_context, updated description
- tasks.md: Marked T048 as REMOVED
Total tools: 20 (was 21)
- User Story 1: 9 tools
- User Story 2: 11 tools (was 12)
Build: ✅ 0 errors
Validation: ✅ Manifest passes
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>