Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault

No arguments

Tools

Functions exposed to the LLM to take actions

NameDescription
set_project_path

Set the base project path for indexing.

search_code_advanced
Search for a code pattern in the project using an advanced, fast tool with pagination support. This tool automatically selects the best available command-line search tool (like ugrep, ripgrep, ag, or grep) for maximum performance. Args: pattern: The search pattern. Can be literal text or regex (see regex parameter). case_sensitive: Whether the search should be case-sensitive. context_lines: Number of lines to show before and after the match. file_pattern: A glob pattern to filter files to search in (e.g., "*.py", "*.js", "test_*.py"). All search tools now handle glob patterns consistently: - ugrep: Uses glob patterns (*.py, *.{js,ts}) - ripgrep: Uses glob patterns (*.py, *.{js,ts}) - ag (Silver Searcher): Automatically converts globs to regex patterns - grep: Basic glob pattern matching All common glob patterns like "*.py", "test_*.js", "src/*.ts" are supported. fuzzy: If True, enables fuzzy/partial matching behavior varies by search tool: - ugrep: Native fuzzy search with --fuzzy flag (true edit-distance fuzzy search) - ripgrep, ag, grep, basic: Word boundary pattern matching (not true fuzzy search) IMPORTANT: Only ugrep provides true fuzzy search. Other tools use word boundary matching which allows partial matches at word boundaries. For exact literal matches, set fuzzy=False (default and recommended). regex: Controls regex pattern matching behavior: - If True, enables regex pattern matching - If False, forces literal string search - If None (default), automatically detects regex patterns and enables regex for patterns like "ERROR|WARN" The pattern will always be validated for safety to prevent ReDoS attacks. start_index: Zero-based offset into the flattened match list. Use to fetch subsequent pages. max_results: Maximum number of matches to return (default 10). Pass None to retrieve all matches. Returns: A dictionary containing: - results: List of matches with file, line, and text keys. - pagination: Metadata with total_matches, returned, start_index, end_index, has_more, and optionally max_results. If an error occurs, an error message is returned instead.
find_files
Find files matching a glob pattern using pre-built file index. Use when: - Looking for files by pattern (e.g., "*.py", "test_*.js") - Searching by filename only (e.g., "README.md" finds all README files) - Checking if specific files exist in the project - Getting file lists for further analysis Pattern matching: - Supports both full path and filename-only matching - Uses standard glob patterns (*, ?, []) - Fast lookup using in-memory file index - Uses forward slashes consistently across all platforms Args: pattern: Glob pattern to match files (e.g., "*.py", "test_*.js", "README.md") Returns: List of file paths matching the pattern
get_file_summary
Get a summary of a specific file, including: - Line count - Function/class definitions (for supported languages) - Import statements - Basic complexity metrics
refresh_index
Manually refresh the project index when files have been added/removed/moved. Use when: - File watcher is disabled or unavailable - After large-scale operations (git checkout, merge, pull) that change many files - When you want immediate index rebuild without waiting for file watcher debounce - When find_files results seem incomplete or outdated - For troubleshooting suspected index synchronization issues Important notes for LLMs: - Always available as backup when file watcher is not working - Performs full project re-indexing for complete accuracy - Use when you suspect the index is stale after file system changes - **Call this after programmatic file modifications if file watcher seems unresponsive** - Complements the automatic file watcher system Returns: Success message with total file count
build_deep_index

Build the deep index (full symbol extraction) for the current project.

This performs a complete re-index and loads it into memory.

get_settings_info

Get information about the project settings.

create_temp_directory

Create the temporary directory used for storing index data.

check_temp_directory

Check the temporary directory used for storing index data.

clear_settings

Clear all settings and cached data.

refresh_search_tools

Manually re-detect the available command-line search tools on the system. This is useful if you have installed a new tool (like ripgrep) after starting the server.

get_file_watcher_status

Get file watcher service status and statistics.

configure_file_watcher

Configure file watcher service settings.

Args: enabled: Whether to enable file watcher debounce_seconds: Debounce time in seconds before triggering rebuild additional_exclude_patterns: Additional directory/file patterns to exclude observer_type: Observer backend to use. Options: - "auto" (default): kqueue on macOS for reliability, platform default elsewhere - "kqueue": Force kqueue observer (macOS/BSD) - "fsevents": Force FSEvents observer (macOS only, has known reliability issues) - "polling": Cross-platform polling fallback (slower but most compatible)

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

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/johnhuang316/code-index-mcp'

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