obsidian_list_commands
Lists all available commands in the Obsidian interface. Ensure a note is open to view commands specific to individual notes.
Instructions
List all available commands you can run in obsidian interface. For commands used on specific notes, make sure to open a note first.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- ListCommandsToolHandler implements the core logic for the 'obsidian_list_commands' tool. It defines the tool schema (empty input) and the run_tool method which fetches and returns the list of Obsidian commands as JSON.class ListCommandsToolHandler(ToolHandler): def __init__(self): super().__init__(TOOL_LIST_COMMANDS) def get_tool_description(self): return Tool( name=self.name, description="List all available commands you can run in obsidian interface. For commands used on specific notes, make sure to open a note first.", inputSchema={ "type": "object", "properties": {}, } ) def run_tool(self, args: dict) -> Sequence[TextContent | ImageContent | EmbeddedResource]: commands = api.list_commands() return [ TextContent( type="text", text=json.dumps(commands, indent=2) ) ]
- src/mcp_obsidian_advanced/server.py:26-43 (registration)TOOL_MAPPING maps the tool name 'obsidian_list_commands' (via tools.TOOL_LIST_COMMANDS) to its handler class ListCommandsToolHandler. This mapping is used in register_tools() to instantiate and register the tool with the MCP server.TOOL_MAPPING = { tools.TOOL_LIST_FILES_IN_DIR: tools.ListFilesInDirToolHandler, tools.TOOL_SIMPLE_SEARCH: tools.SearchToolHandler, tools.TOOL_PATCH_CONTENT: tools.PatchContentToolHandler, tools.TOOL_PUT_CONTENT: tools.PutContentToolHandler, tools.TOOL_APPEND_CONTENT: tools.AppendContentToolHandler, tools.TOOL_DELETE_FILE: tools.DeleteFileToolHandler, tools.TOOL_COMPLEX_SEARCH: tools.ComplexSearchToolHandler, tools.TOOL_BATCH_GET_FILES: tools.BatchGetFilesToolHandler, tools.TOOL_PERIODIC_NOTES: tools.PeriodicNotesToolHandler, tools.TOOL_RECENT_PERIODIC_NOTES: tools.RecentPeriodicNotesToolHandler, tools.TOOL_RECENT_CHANGES: tools.RecentChangesToolHandler, tools.TOOL_UNDERSTAND_VAULT: tools.UnderstandVaultToolHandler, tools.TOOL_GET_ACTIVE_NOTE: tools.GetActiveNoteToolHandler, tools.TOOL_OPEN_FILES: tools.OpenFilesToolHandler, tools.TOOL_LIST_COMMANDS: tools.ListCommandsToolHandler, tools.TOOL_EXECUTE_COMMANDS: tools.ExecuteCommandsToolHandler, }
- src/mcp_obsidian_advanced/server.py:96-109 (registration)register_tools() function instantiates handlers from TOOL_MAPPING (including ListCommandsToolHandler for obsidian_list_commands) and adds them to tool_handlers dict, which is used by @app.list_tools() and @app.call_tool(). Called automatically."""Register the selected tools with the server.""" tools_to_include = parse_include_tools() registered_count = 0 for tool_name in tools_to_include: if tool_name in TOOL_MAPPING: handler_class = TOOL_MAPPING[tool_name] handler_instance = handler_class() add_tool_handler(handler_instance) registered_count += 1 logger.debug(f"Registered tool: {tool_name}") logger.info(f"Successfully registered {registered_count} tools")
- Constant defining the tool name 'obsidian_list_commands' used throughout the codebase for this tool.TOOL_LIST_COMMANDS = "obsidian_list_commands"