Skip to main content
Glama

workspace_symbols

Search for Java symbols in your workspace using Eclipse JDT.LS to navigate code, find definitions, and access Javadoc across projects.

Instructions

Search for symbols in the workspace.

Args: query: Search query string (symbol name or pattern) file_path: Optional file path to determine which project to search

Returns: Dictionary with 'symbols' array or 'status'/'message' if initializing

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
file_pathNo

Implementation Reference

  • The main handler function for the workspace_symbols tool. It uses the LSP workspace/symbol request to search for symbols across the workspace, formats them, and returns a list.
    @mcp.tool() async def workspace_symbols( query: str, file_path: str | None = None, ) -> dict: """ Search for symbols in the workspace. Args: query: Search query string (symbol name or pattern) file_path: Optional file path to determine which project to search Returns: Dictionary with 'symbols' array or 'status'/'message' if initializing """ manager = get_manager() if manager is None: return {"status": "error", "message": "Server not initialized"} # If file_path provided, use that project; otherwise use first available if file_path: client, status = await manager.get_client_for_file_with_status(Path(file_path)) else: # Get any initialized client for project in manager._projects.values(): if project.client and project.client.is_initialized: client = project.client status = "ready" break else: return { "status": "error", "message": "No initialized projects. Provide a file_path to start initialization." } if client is None: return {"status": "initializing", "message": status} response = await client.request( LSP_WORKSPACE_SYMBOL, { "query": query, } ) if response is None: return {"symbols": []} # Response is SymbolInformation[] symbols = [format_symbol(sym) for sym in response] return {"symbols": symbols}

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jonmmease/jons-mcp-java'

If you have feedback or need assistance with the MCP directory API, please join our Discord server