List all available MCP tools. Shows all tools that can be called by AI assistants through the MCP interface.
()
| 150 | |
| 151 | @mcp_app.command("tools") |
| 152 | def mcp_tools(): |
| 153 | """ |
| 154 | List all available MCP tools. |
| 155 | |
| 156 | Shows all tools that can be called by AI assistants through the MCP interface. |
| 157 | """ |
| 158 | _load_credentials() |
| 159 | console.print("[bold green]Available MCP Tools:[/bold green]") |
| 160 | try: |
| 161 | # Instantiate the server to access the tool definitions. |
| 162 | server = MCPServer() |
| 163 | tools = server.tools.values() |
| 164 | |
| 165 | table = Table(show_header=True, header_style="bold magenta") |
| 166 | table.add_column("Tool Name", style="dim", width=30) |
| 167 | table.add_column("Description") |
| 168 | |
| 169 | for tool in sorted(tools, key=lambda t: t['name']): |
| 170 | table.add_row(tool['name'], tool['description']) |
| 171 | |
| 172 | console.print(table) |
| 173 | |
| 174 | except ValueError as e: |
| 175 | console.print(f"[bold red]Error loading tools:[/bold red] {e}") |
| 176 | console.print("Please ensure your database is configured correctly.") |
| 177 | except Exception as e: |
| 178 | console.print(f"[bold red]An unexpected error occurred:[/bold red] {e}") |
| 179 | |
| 180 | # Abbreviation for mcp setup |
| 181 | @app.command("m", rich_help_panel="Shortcuts") |
nothing calls this directly
no test coverage detected