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