Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
GITHUB_TOKENNoGitHub personal access token with pull request read access
GITLAB_TOKENNoGitLab personal access token with api scope
MYOPIC_AUTO_PULLNoSet to '1' to auto-pull missing embedding model on first use (default off)
MYOPIC_AUTO_INDEXNoSet to '0' to disable auto-indexing during review (default on)
MYOPIC_GITLAB_URLNoGitLab base URL (default https://gitlab.com)
MYOPIC_OLLAMA_URLNoOllama server URL (default http://localhost:11434)
MYOPIC_EMBED_MODELNoEmbedding model name for semantic layer (default unclemusclez/jina-embeddings-v2-base-code)

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
mr_changed_filesA

List the files changed in a merge request with stats — no diff content.

The cheap entry point for large reviews: the payload has no diff content, so it stays small even on a very large MR. Each file reports additions/deletions, new/deleted/renamed flags, and a reviewability flag (lockfiles, generated code, binary assets, and enormous single-file changes are marked reviewable=false with a skip_reason). Files are ordered reviewable-first then largest-change-first, so you can batch the highest-value files straight into mr_diff_lines(url, files_filter=[...]).

Args: url: Full GitLab merge request URL.

Returns: {mr_number, title, author, branches, commits, diff_shas, files[{file_path, additions, deletions, reviewable, skip_reason, ...}], stats{total_files, reviewable_files, skipped_files, ...}}

mr_diff_sectionsA

Fetch a merge request's diff grouped by enclosing function/class, not raw hunks.

AST-aware for new files (full tree-sitter chunking) and hunk-context-aware for modified files (declaration pattern + hunk-header hint). All changed lines (add/del) are always included — nothing dropped, only the framing changes. Prefer this over mr_diff_lines on a large MR (many files or a big diff) since grouping by symbol keeps the payload small without truncating mid-function.

Token-safe by construction, same guarantees as mr_diff_lines: on a large MR it returns a bounded page of files and lists the rest under "omitted_files" with "truncated": true. Noise files (lockfiles, generated, binary) are listed under "skipped_files", not expanded. For unknown-size MRs, call mr_changed_files first, then batch files_filter here.

Args: url: Full GitLab merge request URL. include_context_lines: Include unchanged surrounding lines in each section. Default False keeps the payload small. files_filter: Optional list of file-path fragments to include. Passing this is a TARGETED fetch — noise-skip and the budget are disabled so you get exactly the files you ask for. max_chars: Token-safety budget for the returned diff body (default 80000). Ignored for targeted fetches. skip_noise: Keep lockfiles/generated/binary out of the body (listed under skipped_files). Default True. Ignored when filtering.

Returns: {mr_number, title, author, branches, description, commits, diff_shas, files[{file_path, language, new_file, deleted_file, additions, deletions, sections[{symbol, symbol_type, start_line, end_line, changes}]}], truncated, omitted_files, skipped_files, stats}

mr_diff_linesA

Fetch a merge request's diff as structured, line-numbered hunks.

Pure data, no LLM. Returns exact file paths, old/new line numbers, and diff content — everything needed to read a change precisely and to compute the diff positions required for inline comments.

Token-safe by construction: on a large MR it returns a bounded page of files and lists the rest under "omitted_files" with "truncated": true (never an oversized payload). Noise files (lockfiles, generated, binary) are listed under "skipped_files", not expanded. For unknown-size MRs, call mr_changed_files first, then batch files_filter here.

Args: url: Full GitLab merge request URL. files_filter: Optional list of file-path fragments to include. Passing this is a TARGETED fetch — noise-skip and the budget are disabled so you get exactly the files you ask for. lines_filter: Optional map of filename-fragment -> target new-file line numbers; returns compact line_mappings instead of full hunks. max_chars: Token-safety budget for the returned diff body (default 80000). Ignored for targeted fetches. skip_noise: Keep lockfiles/generated/binary out of the body (listed under skipped_files). Default True. Ignored when filtering.

Returns: {mr_number, ..., diff_shas, files[...], truncated, omitted_files, skipped_files, stats}

mr_review_statusA

Get a merge request's review status: metadata + discussions + resolution.

Pure data, no LLM. Collapses several platform API calls into one snapshot of where the review stands — every discussion thread, what's resolved vs open, general comments, and a lightweight file-change summary. Start here to orient before diving into the diff.

Args: url: Full GitLab merge request URL.

Returns: {mr_number, title, author, branches, state, merge_status, commits, general_comments, discussions[...], summary{resolved, unresolved, ...}, files_changed[...], stats}

dependency_impactA

Find everywhere a symbol is used in a checked-out repo (the blast radius).

The highest-value review signal: before you approve a change to a function, class, or constant, see who depends on it. Uses ripgrep for fast candidate finding, then classifies each usage via tree-sitter AST as call / import / definition / type_reference. Filesystem-based — point it at a LOCAL clone of the repo the MR belongs to, not the MR URL.

Args: symbol: Function/class/variable name to trace. root: Absolute path to the local repository clone. file_glob: Optional glob to narrow the search (e.g. ".py", "src/**/.ts"). whole_word: Match whole words only (default True). max_results: Cap on references returned (default 50).

Returns: {symbol, root, total_references, references[{file_path, line, context, usage_type}], by_type{...}}

trace_call_chainA

Trace a function's callers and callees across a checked-out repo (AST).

Complements dependency_impact: where dependency_impact lists every reference, this builds the directed call graph — where the symbol is defined, what it calls, and what calls it — so you can reason about a change's ripple effects. Tree-sitter-based; point it at a LOCAL clone of the repo.

Args: symbol: Function or class name to trace. root: Absolute path to the local repository clone. language: Restrict to one language; auto-detects if omitted. max_depth: Levels of callers/callees to follow (default 1).

Returns: {symbol, definition{file_path, line, type}, callees[...], callers[...], stats{files_scanned, parse_errors}}

index_repoA

Build or incrementally refresh a semantic search index for a local repository.

Walks the repo, chunks every supported-language file by AST boundaries, embeds the chunks via a local Ollama server, and stores them in a per-repo LanceDB table. After the first build this is INCREMENTAL: only files whose content changed since the last run are re-embedded, so refreshing is cheap — run it freely (e.g. when index_status reports "stale"). A changed embedding model or force=True does a full rebuild. Requires a running Ollama (the semantic layer is built in; run myopic doctor to set it up) at MYOPIC_OLLAMA_URL (default http://localhost:11434) with the model pulled (MYOPIC_EMBED_MODEL).

Args: root: Absolute path to the repository to index. force: Rebuild the whole index even if an up-to-date one exists.

Returns: {mode, indexed_chunks, files, skipped, changed_files, deleted_files, git_sha, model} on success, or {"error": "..."} on failure.

index_statusA

Report whether a repo's semantic index is fresh, stale, or absent.

Freshness is keyed to the git commit the index was built from — if HEAD has moved on, the index is "stale" and reports how many commits behind. Check this before leaning on semantic results (code_search / mr_review_context): if state is "stale" or "model_mismatch", offer to index_repo(root) first.

Args: root: Absolute path to the repository.

Returns: {state: absent|fresh|stale|model_mismatch|unknown, root, chunks?, indexed_at?, indexed_sha?, current_sha?, commits_behind?, reason?} or {"error": "..."} if the semantic extra is not installed.

code_searchA

Hybrid semantic + full-text search over an indexed local repository.

Embeds the query via Ollama, then runs a combined vector + FTS search with RRF reranking against the LanceDB index built by index_repo. Use this to find existing patterns, conventions, or examples in the codebase before reviewing a new implementation. Requires a running Ollama (the semantic layer is built in) and index_repo to have been run first.

Args: query: Natural language or code snippet describing what to find. root: Absolute path to the repository (must have been indexed first). k: Maximum number of results to return (default 8).

Returns: {query, root, results[{file_path, symbol, symbol_type, start_line, end_line, text, score?}]} or {"error": "..."} on failure.

mr_review_contextA

Graph-first review context: dependency impact per changed symbol, plus optional semantic enrichment.

Extracts the top-N most-frequent identifiers from the MR diff, then for each:

  1. Runs dependency_impact(symbol, root) — always, no optional extras needed.

  2. If the repo has been indexed via index_repo(root), enriches each symbol with related_patterns from a hybrid semantic search against the codebase.

The semantic layer is purely additive: a result with semantic_available=false is complete and actionable — dependency impact already covers the blast radius. Use this as a single-call alternative to running dependency_impact separately for each changed symbol.

Args: url: Full GitLab merge request URL. root: Absolute path to the local repository clone. max_symbols: Maximum changed symbols to analyze (default 8).

Returns: {mr_number, symbols[{symbol, impact, related_patterns?}], symbol_source, semantic_available, root_status?, warning?, index_status?} or {"error": "..."}. A "warning" means root isn't checked out to the MR — set it up with myopic worktree <url> <repo> and re-run against its path.

mr_verify_reviewA

Check whether each review thread was addressed by nearby diff changes.

Joins the review's discussions with its current diff: for every inline comment thread, surfaces the add/del lines within +/-window of the commented line. A thread with no nearby changes is a candidate for "not yet addressed"; one with changes shows exactly what moved near it — a fast re-review pass without re-reading the whole diff. Read-only. Works on GitLab and GitHub (note: GitHub doesn't expose thread resolution via REST, so rely on has_changes there, not the resolved flag).

Args: url: Full merge/pull request URL. window: Lines before/after the commented line to scan (default 40).

Returns: {mr_number, title, summary{total_threads, resolved, unresolved, threads_with_changes, threads_without_changes}, threads[{..., nearby_changes, has_changes}], threads_no_location[...]}

mr_post_commentsA

Post inline review comments to a merge/pull request. WRITE — this mutates the review.

The only mutating tool in myopic. Posts each comment one at a time from a queue, immediately visible (no drafts, no bulk-publish), retrying transient failures (HTTP 429/5xx) with exponential backoff — so partial progress survives a failure and self-hosted rate limits are respected. Works on GitLab and GitHub; the backend translates positions. Only call this on the user's explicit request to post — never speculatively.

Get exact line numbers first from mr_diff_lines (its lines_filter maps a source line to the diff position). Each comment needs file_path, body, and at least one of new_line (added/unchanged line) or old_line (removed line).

Args: url: Full merge/pull request URL. comments: List of {file_path, body, new_line?, old_line?, old_path?}. max_comments: Safety cap per call (default 25); split larger batches.

Returns: {url, platform, total, posted, failed, published, publish_error, details[{file_path, line, status, error}]} or {"error": "..."}.

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/SurajKGoyal/myopic'

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