Skip to main content
Glama
VIethoangnguyenle

Understand-Anything MCP Server

Understand-Anything MCP Server

🧠 Understand-Anything MCP Server

MCP Server giúp trợ lý AI hiểu sâu bất kỳ codebase nào thông qua Knowledge Graph.

Python 3.12+ MCP License: MIT


Giới thiệu

MCP Server này tải các Knowledge Graph được tạo bởi Understand-Anything và cung cấp chúng dưới dạng các tool có thể truy vấn cho bất kỳ trợ lý AI tương thích MCP nào (Gemini CLI, Claude Desktop, Cursor, v.v.).

Server hỗ trợ hai loại đồ thị đồng thời cho mỗi dự án:

Đồ thị

Tệp

Nội dung

Code Graph

knowledge-graph.json

Files, functions, classes, imports, chuỗi gọi hàm, các tầng kiến trúc

Domain Graph

domain-graph.json

Nghiệp vụ (domains), luồng xử lý (flows), bước (steps), thực thể, quy tắc nghiệp vụ

Hỗ trợ đa dự án — Tải N dự án cùng lúc và truy vấn bất kỳ dự án nào. AI tự động nhận diện dự án phù hợp dựa trên ngữ cảnh workspace.

Tính năng nổi bật

  • 🔍 Tìm kiếm mờ (Fuzzy search) — Tìm kiếm có trọng số (tên 3x > mô tả 1.5x > tags 1x) sử dụng rapidfuzz

  • 🏗️ Tầng kiến trúc — Truy vấn theo layer (controller, service, repository, v.v.)

  • 🌊 Truy vết chuỗi gọi hàm — Duyệt BFS theo các lời gọi hàm

  • 💥 Phân tích vùng ảnh hưởng — Tìm tất cả node bị ảnh hưởng khi thay đổi một node (BFS ngược)

  • 🎯 Phát hiện entry point — Nhận diện API endpoint và các hàm không được gọi bởi hàm khác

  • 🏢 Tri thức nghiệp vụ — Domains, flows, steps, thực thể và quy tắc nghiệp vụ

  • 📖 Trích xuất mã nguồn đa ngôn ngữ — Đọc source code thực tế của bất kỳ node nào, hỗ trợ trích xuất symbol-level cho Java, Kotlin, TypeScript, JavaScript, Python, Go, Rust, C#

  • 🔗 Tìm đường ngắn nhất — BFS vô hướng giữa hai node bất kỳ trong đồ thị

  • 🏛️ Cây kế thừa — Truy vết extends/implements lên và xuống toàn bộ hệ thống phân cấp class

  • 📁 Tìm kiếm theo đường dẫn — Tìm tất cả node theo package/module/thư mục path (O(P) qua path index)

  • 🌉 Domain↔Code Cross-reference — Tự động bridge từ domain step → code node qua _nodes_by_path index O(1), semantic ranking khi prefix match (penalize boilerplate, ưu tiên class liên quan theo tên/mô tả/tags)

  • 🔄 Tự động tải lại — Phát hiện khi file graph thay đổi trên đĩa và tự động reload

  • Phân tích độ mới — So sánh commit hash của graph với HEAD hiện tại qua git diff

  • Edge Resolution Layer — Class và function node tự động kế thừa quan hệ từ file cha, tra cứu O(degree) qua edge index

  • 🧪 59 unit tests — Bộ test toàn diện bảo vệ regressions, chạy trong <0.1s

  • 📚 Skill kèm theocodebase-explain: hướng dẫn AI giải thích sâu file/symbol/module/business flow bằng evidence read-only từ server (output có cấu trúc, gắn freshness, không bịa node ID)


Related MCP server: PT-MCP (Paul Test Man Context Protocol)

Bắt đầu nhanh

Yêu cầu

  • Python ≥ 3.12

  • Trình quản lý package uv

  • Một dự án đã được tạo graph bởi Understand-Anything (thư mục .understand-anything/)

Cài đặt & Chạy

# Clone repository
git clone https://github.com/VIethoangnguyenle/Understand-Anything-MCP.git
cd Understand-Anything-MCP

# Cài đặt dependencies
uv sync

# Chạy với MCP Inspector (để test/debug)
PROJECT_ROOTS=/đường/dẫn/tới/dự-án npx @modelcontextprotocol/inspector uv run server.py

# Chạy MCP dev server
PROJECT_ROOTS=/đường/dẫn/tới/dự-án mcp dev server.py

Đa dự án

Đặt PROJECT_ROOTS là danh sách đường dẫn phân cách bằng dấu phẩy:

PROJECT_ROOTS=/đường/dẫn/dự-án-a,/đường/dẫn/dự-án-b uv run server.py

Mỗi tool đều nhận tham số project tùy chọn. Nếu chỉ có một dự án được tải, nó sẽ được sử dụng tự động.


Chạy bằng Docker

Repo kèm sẵn Dockerfilecompose.example.yaml để chạy server trong container — không cần cài Python hay uv trên máy, và dự án được mount chỉ đọc.

Dựng ảnh

docker build -t ua-mcp:local .

Chạy một lần

Server nói MCP qua stdio, không mở cổng nào. Vì vậy phải chạy với -i, và đừng docker compose up -d — container sẽ khởi động rồi thoát ngay vì không ai nối vào stdin.

docker run -i --rm \
  -v /đường/dẫn/dự-án:/data/du-an:ro \
  -e PROJECT_ROOTS=/data/du-an \
  -e GIT_CONFIG_COUNT=1 \
  -e GIT_CONFIG_KEY_0=safe.directory \
  -e GIT_CONFIG_VALUE_0='*' \
  ua-mcp:local

Hoặc chép compose.example.yaml thành compose.yaml, sửa đường dẫn, rồi:

docker compose run --rm -T ua-mcp

Nối vào MCP client

Trỏ client thẳng vào docker, thay vì uv:

{
  "mcpServers": {
    "understand-anything": {
      "command": "docker",
      "args": [
        "run", "-i", "--rm",
        "-v", "/đường/dẫn/dự-án:/data/du-an:ro",
        "-e", "PROJECT_ROOTS=/data/du-an",
        "-e", "GIT_CONFIG_COUNT=1",
        "-e", "GIT_CONFIG_KEY_0=safe.directory",
        "-e", "GIT_CONFIG_VALUE_0=*",
        "ua-mcp:local"
      ]
    }
  }
}

Hai cái bẫy khiến FRESHNESS luôn UNKNOWN

Cả hai đều fail trong im lặng — server chạy bình thường, tool trả lời bình thường, chỉ có FRESHNESS âm thầm về UNKNOWN mãi mãi. Nhìn từ ngoài giống hệt như dự án không phải git checkout, nên rất dễ bỏ qua.

  1. Ảnh phải có git. check_freshness gọi git rev-parse HEADgit diff bên trong thư mục dự án. Base python:3.12-slim không kèm git; thiếu nó thì FileNotFoundError bị nuốt và mọi dự án đều báo UNKNOWN. Dockerfile trong repo đã cài sẵn.

  2. Phải khai báo safe.directory. Dự án mount vào container thường thuộc uid khác với user chạy trong container, git từ chối với dubious ownership và mọi lệnh đều fail. Dùng biến môi trường GIT_CONFIG_COUNT / GIT_CONFIG_KEY_0 / GIT_CONFIG_VALUE_0 thay vì ghi ~/.gitconfig — container chạy read_only nên không ghi file config được.

Kiểm nhanh sau khi dựng ảnh:

docker run --rm ua-mcp:local git --version

Rồi gọi get_graph_stats và xem mục FRESHNESS có thoát khỏi UNKNOWN không.

Ghi chú bảo mật

compose.example.yaml mặc định bật read_only: true, cap_drop: ALL, no-new-privileges, và chạy bằng uid không phải root (1001). Server chỉ đọc graph rồi trả lời truy vấn nên không cần ghi gì; chỉ khi bật usage metrics mới cần đúng một mount ghi được.


Cấu hình MCP Client

Gemini CLI / Antigravity

Thêm vào ~/.gemini/antigravity/mcp_config.json:

{
  "understand-anything": {
    "command": "uv",
    "args": ["--directory", "/đường/dẫn/tuyệt/đối/tới/Understand-Anything-MCP", "run", "server.py"],
    "env": {
      "PROJECT_ROOTS": "/đường/dẫn/tới/dự-án-a,/đường/dẫn/tới/dự-án-b"
    }
  }
}

Claude Desktop

Thêm vào claude_desktop_config.json:

{
  "mcpServers": {
    "understand-anything": {
      "command": "uv",
      "args": ["--directory", "/đường/dẫn/tuyệt/đối/tới/Understand-Anything-MCP", "run", "server.py"],
      "env": {
        "PROJECT_ROOTS": "/đường/dẫn/tới/dự-án"
      }
    }
  }
}

Cursor / Các MCP Client khác

Sử dụng cùng cấu trúc — đặt commanduv, truyền đường dẫn server qua --directory, và cấu hình PROJECT_ROOTS trong env.


Danh sách Tools (17 tools)

Khám phá & Tổng quan

Tool

Mô tả

list_projects

Liệt kê tất cả dự án đã đăng ký kèm số lượng node/edge và thông tin domain

get_graph_stats

Thống kê toàn diện: phân bố type, layers, phân tích độ mới của graph

get_graph_metadata

Snapshot JSON có cấu trúc: counts, graph commit, repository HEAD, freshness (bản machine-readable của get_graph_stats)

get_tour

Tour hướng dẫn dự án — các điểm dừng được chọn lọc giải thích các thành phần chính

Truy vấn Code Graph

Tool

Mô tả

query_nodes

Tìm kiếm mờ có trọng số theo từ khóa. Hỗ trợ lọc node_type và phân trang

get_node_detail

Chi tiết đầy đủ của một node theo ID: đường dẫn, layer, độ phức tạp, tags, số lượng quan hệ

get_node_source

Đọc mã nguồn thực tế của node. Trích xuất symbol-level đa ngôn ngữ (Java/Kotlin/TS/Python/Go/...)

get_relationships

Tất cả node liên kết kèm loại quan hệ. Class/function tự động kế thừa edge từ file cha

trace_call_chain

Cây gọi hàm BFS từ một function (theo edge calls, độ sâu có thể cấu hình)

get_layer_info

Liệt kê các tầng kiến trúc hoặc lấy tất cả node trong một layer cụ thể

find_entry_points

Các function không được gọi bởi function khác — tiềm năng là API endpoint

find_impact

Vùng ảnh hưởng: tất cả node bị ảnh hưởng nếu node này thay đổi (BFS ngược)

Truy vấn nâng cao

Tool

Mô tả

find_path

Tìm đường đi ngắn nhất giữa hai node (BFS vô hướng, tối đa 10 hop)

get_class_hierarchy

Cây kế thừa extends/implements — hỗ trợ hướng up/down/both

search_by_file_path

Tìm node theo pattern đường dẫn file (O(P) qua path index, case-insensitive)

Truy vấn Domain Graph

Tool

Mô tả

get_domain_overview

Tổng quan tất cả domain nghiệp vụ kèm flows, thực thể, và mô tả

get_domain_detail

Chi tiết sâu về một domain: thực thể, quy tắc nghiệp vụ, flows, steps, code cross-ref

get_domain_flow_detail

Deep-dive vào một flow cụ thể: entry point, ordered steps, code cross-references


Skills

Thư mục skills/ chứa các Claude Code skill tương tác với server này.

codebase-explain

Giải thích sâu một file, symbol, module, class, function hoặc business flow bằng evidence read-only từ server — không đọc source local, không bịa node ID/path/line.

/codebase-explain [project-name] [file-path|symbol|module|business-flow]

Skill quy định:

  • Freshness gate — luôn kiểm tra get_graph_stats và gán FRESH|STALE|UNKNOWN trước mọi claim quan trọng.

  • Exact-match validation — kết quả fuzzy chỉ là candidate; phải khớp đúng path/symbol/flow name mới được deep dive, nếu không chuyển sang ambiguity review.

  • 9-section output — output tiếng Việt có cấu trúc, mọi claim gắn Source/Project/Freshness/Tool/Claim.

  • Ambiguity gate — target mơ hồ sinh file review HTML thay vì đoán.

Skill là markdown thuần — thêm vào .claude/skills/ của project hoặc cài làm plugin để dùng /codebase-explain.


Kiến trúc

flowchart TD
    Client["MCP Client<br/>Gemini CLI · Claude · Cursor"]

    subgraph Server["server.py"]
        FastMCP["FastMCP · 17 tools<br/>list_projects · query_nodes · find_impact<br/>find_path · get_class_hierarchy · get_domain_flow_detail · ..."]
        Registry["Multi-Project Registry<br/>cache theo mtime · tự động reload · resolve"]
    end

    subgraph Loader["kg_loader.py"]
        direction TB
        DataLayer["Tầng Dữ liệu<br/>Node · Edge · LayerInfo · TourStop<br/>DomainNode · DomainEdge · ProjectGraph"]
        EdgeRes["Edge Resolution Layer<br/>class/function → file edge inheritance<br/>O(1) node index · O(degree) edge index"]
        Query["Query Engine<br/>fuzzy search · BFS traversal · impact analysis<br/>shortest path · class hierarchy · path search"]
        Source["Source Extraction<br/>brace-counting Java/Kotlin/TS/JS/Go/Rust/C#<br/>indent-tracking Python"]
        DataLayer --> EdgeRes --> Query --> Source
    end

    subgraph UA[".understand-anything/"]
        KG["knowledge-graph.json<br/>đồ thị code-level"]
        DG["domain-graph.json<br/>đồ thị nghiệp vụ"]
        Meta["meta.json<br/>metadata phân tích"]
    end

    Client -->|"stdio · MCP Protocol"| Server
    FastMCP --> Registry
    Registry --> DataLayer
    Source -->|"đọc JSON"| KG
    Source -.->|"đọc JSON"| DG
    Source -.->|"đọc JSON"| Meta

Cấu trúc tệp

Understand-Anything-MCP/
├── server.py          # MCP server — định nghĩa 17 tools, registry đa dự án
├── kg_loader.py       # Bộ tải graph & query engine — data models, search, traversal, resolution
├── metrics.py         # Usage metrics — 1 JSON line / tool call, rotating file, fail-safe
├── pyproject.toml     # Cấu hình dự án — dependencies: mcp[cli], rapidfuzz, pytest (dev)
├── Dockerfile         # Build đa tầng, chạy non-root, có sẵn git cho check_freshness
├── compose.example.yaml  # Mẫu compose — chép thành compose.yaml rồi sửa đường dẫn
├── .dockerignore      # Loại .venv/, tests/, cache ra khỏi build context
├── scripts/           # Bộ script vận hành — clone, pull, re-index, gitignore
│   ├── clone-repos.sh       # Clone repo từ manifest CSV vào REPO_ROOT (idempotent)
│   ├── git-pull.sh          # Pull toàn bộ repo + report JSON
│   ├── git-pull-run.sh      # Wrapper systemd: lưu JSON, alert webhook
│   ├── sync-graph.sh        # Re-index graph incremental bằng claude agent trong docker
│   ├── sync-graph-run.sh    # Wrapper cron: pull + sync + alert
│   ├── check-graph-ignore.sh    # Kiểm tra .understand-anything/ được ignore đúng
│   ├── revert-gitignore-graph.sh  # Hoán .gitignore sang .git/info/exclude
│   └── test/                  # Harness test (git repo giả + docker giả)
├── skills/            # Claude Code skills
│   └── codebase-explain/
│       └── SKILL.md           # Giải thích sâu codebase bằng evidence read-only
├── tests/             # Bộ test tự động
│   ├── test_kg_loader.py    # Unit tests cho core loader, query engine & cross-ref
│   ├── test_graph_metadata.py  # Tests cho get_graph_metadata
│   ├── test_path_safety.py     # Tests cho path containment
│   ├── test_metrics.py         # Unit tests cho metrics writer
│   ├── test_metrics_integration.py  # Wiring metrics vào FastMCP tool surface
│   ├── test_symbol_coverage.py # Tests cho compute_symbol_coverage
│   └── fixtures/            # Dữ liệu test JSON mẫu
│       ├── knowledge-graph.json
│       └── domain-graph.json
├── uv.lock            # Dependencies đã khóa phiên bản
└── README.md

Biến môi trường

Biến

Bắt buộc

Mô tả

PROJECT_ROOTS

Danh sách đường dẫn tuyệt đối phân cách bằng dấu phẩy tới các dự án có thư mục .understand-anything/

UPSTREAM_ROOTS

Không

Danh sách đường dẫn tới thư mục gốc của thư viện upstream/dùng chung (để resolve source code của upstream node)

UA_MCP_METRICS_FILE

Không

Đường dẫn file JSONL cho usage metrics. Rỗng = disable hoàn toàn (mặc định). Xem section Usage Metrics


Usage Metrics

Module metrics.py đo usage của tool surface — 1 JSON line cho mỗi tool call, append vào file rotating có size cap. Dữ liệu trả lời ba câu hỏi:

  1. Adoption — ua-mcp có thực sự được dùng không? Tool nào được gọi, bao nhiêu lần?

  2. Điểm yếu — Chỗ nào trả về kết quả rỗng, lỗi, hay tool nào không ai gọi (dead tool)?

  3. Hỏi lặp — Cùng một caller có đang hỏi cùng một câu hỏi không? (detection qua caller + arg_hash trong time window)

Thiết kế an toàn

Hard rule: ghi metrics không bao giờ được phá tool call. Mọi failure path đều được swallow (file không ghi được, disk full, JSON không serialize được), và writer tự disable vĩnh viễn sau 5 lần lỗi liên tiếp — không còn retry, không còn log spam, tool call chạy tiếp bình thường.

  • Caller key — hash ip + user_agent, không lưu IP raw (tránh PII)

  • Arg hash — SHA-256 của (tool, args), args dài được truncate trước khi ghi nhưng hash vẫn tính trên bản đầy đủ

  • Outcome classification — phân loại ok / empty / error / exception dựa trên giá trị trả về

  • Rotating file — size cap, không tăng vô hạn

Kích hoạt

# Mặc định: metrics TẮT (không ghi gì)
PROJECT_ROOTS=/đường/dẫn/dự-án uv run server.py

# Bật metrics: set UA_MCP_METRICS_FILE
UA_MCP_METRICS_FILE=/var/log/ua-mcp/metrics.jsonl \
PROJECT_ROOTS=/đường/dẫn/dự-án uv run server.py

Wiring

server.py gọi metrics.install(mcp) trước tool đầu tiên được khai báo bằng @mcp.tool(). Vì decorator chạy khi import theo thứ tự source, tool nào khai báo trên dòng install sẽ không bị đo — test test_every_registered_tool_is_instrumented bảo vệ invariant này.

# Chạy test metrics
uv sync --group dev
uv run pytest tests/test_metrics.py tests/test_metrics_integration.py -v

Cách hoạt động

  1. Khi khởi động, server quét PROJECT_ROOTS và tải knowledge-graph.json + domain-graph.json từ thư mục .understand-anything/ của mỗi dự án.

  2. Index được xây dựng trong bộ nhớ:

    • _node_index: tra cứu node theo ID — O(1)

    • _edges_by_source / _edges_by_target: tra cứu edge — O(degree)

    • _domain_edges_by_source: index riêng cho domain graph

    • _nodes_by_path: ánh xạ file_path → nodes — O(1), dùng cho cross-ref và path search

    • Layer enrichment: gán layer vào từng node dựa trên ánh xạ layer

  3. Edge Resolution Layer — Khi truy vấn quan hệ của class/function node:

    • Resolve tới parent file qua edge contains

    • Kế thừa outgoing edges từ file cha (imports, contains, v.v.)

    • Loại bỏ self-reference và deduplicate

  4. Khi một tool được gọi, server kiểm tra mtime của file graph trên đĩa và tự động tải lại nếu cần.

  5. Tìm kiếm mờ sử dụng rapidfuzz với điểm số có trọng số — kết quả khớp tên được đánh trọng số cao gấp 3 lần so với khớp mô tả, kèm bonus cho khớp chính xác chuỗi con.

  6. Trích xuất mã nguồn đa ngôn ngữ — Tự động nhận diện ngôn ngữ qua extension và chọn chiến lược phù hợp:

    • Brace-counting: Java, Kotlin, TypeScript, JavaScript, Go, Rust, C#

    • Indent-tracking: Python (word-boundary regex, shallowest-indent preferred)

  7. Domain↔Code Cross-referenceresolve_domain_to_code() bridge domain steps tới code nodes:

    • Strategy 1: Exact file_path match qua _nodes_by_path index (O(1))

    • Strategy 2: Directory prefix match với semantic ranking — khi filePath trỏ vào package directory:

      • Collect tất cả class/file nodes trong package (không early exit)

      • Scoring: +20 cho tên token khớp summary, +15 khớp step name, +10 khớp tags, +50 cho full class name match

      • Penalty: −50 cho boilerplate patterns (Application, Config, Interceptor, Test, Utils, v.v.)

      • Bonus: +2/level cho files nằm sâu trong subdirectory (thường cụ thể hơn)

    • Priority: class > file > function

  8. Domain edge type constantsDOMAIN_REL_CONTAINS_FLOW, DOMAIN_REL_FLOW_STEP, v.v. — single source of truth, tránh typo

  9. Kiểm tra độ mới chạy lệnh git diff <commit_phân_tích>..HEAD để phát hiện số lượng file code đã thay đổi kể từ lần tạo graph gần nhất.


Vận hành đồ thị (scripts/)

Bộ script trong scripts/ giúp vận hành graph ở quy mô nhiều repo trên một server — clone, pull, re-index, và giữ git status sạch. Tất cả script:

  • Mặc định dry-run khi cần ghi — phải truyền --apply mới thực thi.

  • JSON ra stdout, log người đọc ra stderr — parse được bằng jq, log tail -f được.

  • Không ghi gì vào repo sản phẩm — graph là runtime state, ignore qua .git/info/exclude (per-clone, sống qua mọi lần pull).

  • Chạy được trên macOS (bash 3.2) và Linux — harness test trong scripts/test/ không cần VM, docker thật, hay LLM.

Kịch bản điển hình

# 1. Clone repo theo manifest CSV vào REPO_ROOT
./scripts/clone-repos.sh --apply

# 2. Pull toàn bộ repo (git-pull.sh) rồi re-index graph incremental (sync-graph.sh)
./scripts/sync-graph-run.sh

# 3. Kiểm tra .understand-anything/ được ignore đúng cách
./scripts/check-graph-ignore.sh --fix

Các script

Script

Chức năng

clone-repos.sh

Clone các repo trong repos.csv vào REPO_ROOT. Idempotent, xử lý được ca "thư mục chỉ chứa .understand-anything/" bằng cách clone ra temp rồi hoán đổi.

git-pull.sh

Pull toàn bộ repo với --rebase, tự resolve branch (upstream → origin/HEAD → remote → local), report JSON kèm status từng repo (ok / up-to-date / dirty / conflict / failed).

git-pull-run.sh

Wrapper systemd: chạy git-pull.sh, lưu JSON + log, prune theo KEEP_RUNS, alert qua webhook.

sync-graph.sh

Re-index knowledge-graph incremental: đọc meta.json .gitCommitHash vs HEAD, chạy claude agent trong docker container với stream-json, có snapshot + rollback khi agent chết giữa chừng, có guard chống graph "degraded" (template summary tăng > 20%).

sync-graph-run.sh

Wrapper cron: pull + sync, alert khi có repo cần can thiệp.

check-graph-ignore.sh

Kiểm tra 3 trạng thái .understand-anything/: ok / not-ignored / tracked. --fix xử lý cả hai bằng cách ghi .git/info/exclude hoặc git update-index --skip-worktree.

revert-gitignore-graph.sh

Hoàn tác sửa tay .gitignore chỉ thêm .understand-anything rồi chuyển quy tắc sang .git/info/exclude. Chỉ revert khi diff an toàn tuyệt đối.

Biến môi trường chính

Biến

Mặc định

Ý nghĩa

CLONE_REPOS_CSV

$SCRIPT_DIR/../repos.csv

Manifest <ten_thu_muc>,<git_url>

CLONE_REPOS_ROOT / GIT_PULL_REPO_ROOT / SYNC_GRAPH_ROOT

/srv/ua-data

Thư mục chứa các repo con

GIT_PULL_SKIP_FILE

~/.git-pull-skip

Danh sách repo bỏ qua, 1 dòng 1 tên

UA_INDEXER_IMAGE

ua-indexer:latest

Docker image chứa claude CLI + plugin understand-anything

UA_INDEXER_NETWORK

bridge

Docker network agent dùng để gọi LLM API

ANTHROPIC_BASE_URL / ANTHROPIC_API_KEY / ANTHROPIC_MODEL

Kết nối LLM (script không quan tâm model nào, chỉ cần CLI tương thích claude -p --output-format stream-json)

SYNC_GRAPH_TIMEOUT / SYNC_GRAPH_FULL_TIMEOUT / SYNC_GRAPH_DOMAIN_TIMEOUT

1800 / 7200 / =TIMEOUT

Timeout từng bước (index / rebuild / domain)

SYNC_GRAPH_MAX_CHANGED

0 (không giới hạn)

Bỏ qua repo có số file đổi vượt ngưỡng

SYNC_GRAPH_LANG

English

Ngôn ngữ summary trong graph

*_ALERT_WEBHOOK

rỗng

Webhook nhận JSON khi có repo lỗi

Harness test

scripts/test/sync-graph-test.sh tạo repo git giả + docker giả (trong scripts/test/bin/) để chạy hết các nhánh kết quả của sync-graph.sh không cần VM, container thật, hay LLM. Các case tương ứng các sự cố thực tế đã gặp (agent thoát 0 nhưng không ghi meta, stderr lẫn vào stream-json, timeout, bước domain bị bỏ trong báo cáo).

./scripts/test/sync-graph-test.sh   # pass=N fail=0

Ví dụ sử dụng

Sau khi kết nối với MCP client, AI có thể sử dụng các tool một cách tự nhiên:

Người dùng: "Luồng xác thực hoạt động như thế nào?"

AI sử dụng: query_nodes(query="authentication") → tìm các node liên quan
AI sử dụng: get_domain_detail(domain_name="authentication") → lấy thông tin domain đầy đủ
AI sử dụng: trace_call_chain(start_node_id="...loginUser") → truy vết cây gọi hàm
Người dùng: "Nếu tôi thay đổi PaymentService thì ảnh hưởng gì?"

AI sử dụng: query_nodes(query="PaymentService") → tìm node
AI sử dụng: find_impact(node_id="...PaymentService") → phân tích vùng ảnh hưởng
Người dùng: "PaymentService kế thừa từ class nào?"

AI sử dụng: query_nodes(query="PaymentService") → tìm node
AI sử dụng: get_class_hierarchy(class_id="class:PaymentService", direction="up") → cây kế thừa
Người dùng: "AuthService và PaymentGateway liên quan thế nào?"

AI sử dụng: find_path(source_id="class:AuthService", target_id="class:PaymentGateway") → đường đi ngắn nhất
Người dùng: "Tất cả file trong package transfer?"

AI sử dụng: search_by_file_path(path_pattern="transfer", node_type="file") → danh sách file
Người dùng: "Luồng xử lý lương chi tiết thế nào?"

AI sử dụng: get_domain_flow_detail(flow_name="payroll") → entry point, ordered steps, code refs

Phát triển

# Cài đặt dependencies
uv sync

# Chạy unit tests
uv run pytest tests/ -v

# Chạy test với MCP Inspector
PROJECT_ROOTS=/đường/dẫn/tới/dự-án npx @modelcontextprotocol/inspector uv run server.py

# Log được ghi ra stderr (stdout được dành riêng cho MCP stdio protocol)

Giấy phép

MIT


Được xây dựng cho hệ sinh thái Understand-Anything

Giúp trợ lý AI hiểu sâu bất kỳ codebase nào 🚀

Available Tools

18 tools
find_entry_pointsA

Find functions that are NOT called by any other function (potential API endpoints / entry points).

Args: project: Project name.

Returns: List of entry point functions with their layer and summary.

ParametersJSON Schema
NameRequiredDescriptionDefault
projectNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It does disclose the core behavior (finding uncalled functions) and the return structure (list with layer and summary), but it does not mention whether it's read-only, any side effects, or performance implications. Without annotations, this is a moderate level of transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise: one sentence for purpose, then clear Args/Returns sections. Every word earns its place, with no redundancy or fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple tool with one parameter and an output schema, the description fully explains what it returns. It doesn't define 'layer' or specify sorting/limits, but these are likely domain-specific and not critical for a basic query tool. It is complete enough for effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0% (no description in the schema property), but the description provides 'project: Project name' which clarifies the parameter's meaning. Since this is the only parameter and its purpose is straightforward, the semantic addition is minimal but sufficient.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Find functions that are NOT called by any other function', which is a specific verb+resource+scope. It distinguishes this tool from siblings like trace_call_chain or find_impact by focusing on uncalled functions as potential entry points.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies when to use it (when seeking entry points) but does not explicitly compare to alternatives or state when not to use it. It lacks clear exclusionary or alternative guidance, so it earns a 3 for implied usage rather than explicit direction.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

find_impactA

Blast radius analysis: find all nodes that would be affected if this node changes.

Follows incoming imports, calls, extends, and implements edges in reverse.

Args: node_id: Node ID to analyze impact for. max_depth: Max traversal depth (default 3, max 10). project: Project name.

Returns: List of affected nodes grouped by depth level.

ParametersJSON Schema
NameRequiredDescriptionDefault
node_idYes
projectNo
max_depthNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden of behavioral disclosure. It explains the traversal direction and edge types, which is useful, but it does not mention how cycles are handled, whether the input node itself is included in results, or performance implications for deep traversals. This is partially transparent but leaves several corner cases unaddressed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and well-structured: a one-sentence purpose, a brief algorithm note, and a clear Args/Returns section. Every sentence provides relevant information with no redundancy or filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description covers purpose, algorithm, parameters, and return shape, and an output schema exists to detail exact return values. Minor gaps such as cycle handling, self-inclusion, and explicit when-to-use guidance prevent a perfect score, but overall it is complete for a query tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description's Args section is essential and does add meaningful context. It explains node_id, max_depth (including default and max), and project by name. However, project is only described as 'Project name' without elaborating on its filtering role, and max_depth's behavior at bounds is unspecified, so it is not fully thorough.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: blast radius analysis to find all nodes affected by a change. It specifies the traversal semantics (following incoming imports, calls, extends, and implements edges in reverse), which distinguishes it from sibling tools like trace_call_chain or find_path.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for impact analysis via 'Blast radius analysis', but it does not explicitly state when to use this tool versus alternatives or provide exclusions. No direct comparison to sibling tools is given, so guidance is implied rather than explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

find_pathA

Find the shortest path between two nodes in the knowledge graph.

Uses undirected BFS — traverses both outgoing and incoming edges. Useful for understanding how two components are connected.

Args: source_id: Starting node ID. target_id: Destination node ID. max_depth: Maximum path length (default 6, max 10). project: Project name.

Returns: Path from source to target showing each hop and relation.

ParametersJSON Schema
NameRequiredDescriptionDefault
projectNo
max_depthNo
source_idYes
target_idYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.1/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description discloses a key behavioral trait: 'Uses undirected BFS — traverses both outgoing and incoming edges.' This is non-obvious and directly affects results. With no annotations, the description carries the burden, and this detail plus the return description provides meaningful transparency, though it doesn't mention edge cases like no-path scenarios.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and well-structured: purpose, algorithm, usage, parameters, and return value. It is front-loaded with the main verb and every sentence contributes information. No redundancy or unnecessary detail.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description covers the purpose, algorithm, parameters, and return format. Since an output schema exists, not detailing the return structure is acceptable. However, it omits behavior when no path is found and under-explains the project param, leaving minor gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It lists each parameter with some meaning: source_id as 'Starting node ID', target_id as 'Destination node ID', max_depth with default and max, and project as 'Project name'. The project description is minimal but present, giving some semantics beyond the raw schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Find the shortest path between two nodes in the knowledge graph', specifying the verb and resource. It doesn't explicitly differentiate from sibling tools like find_impact, but the purpose is specific enough that it likely won't be confused with other tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The line 'Useful for understanding how two components are connected' provides clear context for when to use the tool. It does not mention explicit alternatives or exclusions, but the context is sufficient for basic guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_class_hierarchyA

Show the inheritance hierarchy for a class (extends/implements tree).

Args: class_id: Class node ID to analyze. direction: "up" (parents/supertypes), "down" (children/subtypes), "both". max_depth: Max traversal depth (default 5, max 10). project: Project name.

Returns: Inheritance tree showing parent and child classes with relation types.

ParametersJSON Schema
NameRequiredDescriptionDefault
projectNo
class_idYes
directionNoboth
max_depthNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden. It discloses the return type ('Inheritance tree showing parent and child classes with relation types') but does not mention error behavior, performance implications, or any side effects. This is acceptable for a simple read-only query but lacks richer context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with a one-line purpose, a concise parameter list, and a return value note. Every sentence earns its place with no redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description covers the core functionality, parameters, and return value. It lacks usage guidance and edge-case behavior, but the presence of an output schema reduces the need to explain return details in prose, making it reasonably complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has 0% description coverage, so the description compensates by explaining each parameter in the Args section, including direction values, max_depth limits, and project name. This adds meaning beyond the schema, though the 'project' parameter could be described more fully.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's function with a specific verb and resource: 'Show the inheritance hierarchy for a class (extends/implements tree).' This distinguishes it from sibling tools like get_relationships or get_node_detail, which are more generic.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance is provided on when to use this tool versus alternatives. The description only explains what it does, leaving the agent to infer its use case from the purpose and parameter names.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_domain_detailA

Get detailed info about a specific business domain: entities, rules, flows, steps.

Args: domain_name: Domain name (e.g., "authentication", "transfer", "payroll"). Fuzzy matching supported. project: Project name.

Returns: Full domain details with entities, business rules, flows and their steps.

ParametersJSON Schema
NameRequiredDescriptionDefault
projectNo
domain_nameYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden for behavioral disclosure. It discloses that fuzzy matching is supported for domain_name and states the return structure ('Full domain details with entities, business rules, flows and their steps'), giving the agent a clear expectation of the read-only nature and output. It does not mention side effects or edge cases, but for a simple getter this is adequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is compact and well-organized with an opening summary, an Args section, and a Returns section. Every sentence adds value: the summary explains what the tool does, the args explain parameters with examples, and the returns sets expectations. No fluff or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With a simple 2-parameter interface, an output schema, and a description that covers both the purpose and return payload, the description is complete for the agent's invocation needs. The project parameter's optionality is implied by the schema default, and the description's examples help disambiguate domain_name.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema provides only titles (0% description coverage), but the description compensates fully. It explains domain_name with concrete examples ('authentication', 'transfer', 'payroll'), notes fuzzy matching, and clarifies project as 'Project name.' This adds meaning far beyond the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with 'Get detailed info about a specific business domain' and enumerates the included content: 'entities, rules, flows, steps.' This is a specific verb+resource+scope, and the enumeration clearly distinguishes it from siblings like get_domain_overview or get_domain_flow_detail by emphasizing 'detailed' and listing all components.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for retrieving a full domain model with fuzzy matching on the domain name. It does not explicitly mention alternatives or when-not-to-use, but the context ('detailed info') and the enumerated contents provide clear guidance on when this tool is appropriate.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_domain_flow_detailA

Deep-dive into a specific business flow: entry point, all steps with ordering, and linked code nodes for each step.

Use this for detailed understanding of a single flow's implementation. For an overview of all domains/flows, use get_domain_overview or get_domain_detail.

Args: flow_name: Flow name (e.g., "SAGA Xử lý Lương", "init payroll", "recovery retry"). Fuzzy matching supported. project: Project name.

Returns: Full flow details with entry point, ordered steps, step summaries, and cross-referenced code nodes for each step.

ParametersJSON Schema
NameRequiredDescriptionDefault
projectNo
flow_nameYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.7/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden. It discloses that fuzzy matching is supported for flow_name, describes the return content (entry point, ordered steps, step summaries, cross-referenced code nodes), and implies a read-only, non-destructive operation. It could add more about pagination or error behavior, but for a query tool it provides solid context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well organized: a one-sentence purpose, a usage section with sibling differentiation, and clearly labeled Args/Returns sections. Every sentence contributes useful information with no redundancy, and the most important info is front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has only two parameters, an output schema, and moderate complexity, the description is complete. It explains what the tool returns, how to get broader context via siblings, and the semantics of the key parameter. The presence of an output schema reduces the need to detail return structure, and the description covers everything else needed for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Although schema description coverage is 0%, the description adds meaningful value for flow_name through examples ('SAGA Xử lý Lương', 'init payroll') and explicitly notes fuzzy matching. It also explains project as simply 'Project name', which is minimal, but the main parameter is well covered. This largely compensates for the schema gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description begins with a specific verb phrase 'Deep-dive into a specific business flow' and precisely lists what is returned: entry point, ordered steps, and linked code nodes. It explicitly contrasts with sibling tools get_domain_overview and get_domain_detail, making its unique role clear.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It directly states when to use the tool ('Use this for detailed understanding of a single flow's implementation') and names alternatives for broader overviews ('For an overview of all domains/flows, use get_domain_overview or get_domain_detail'). This gives explicit when and when-not guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_domain_overviewB

Get summary of all business domains and their flows (from domain-graph.json).

Args: project: Project name.

Returns: List of domains with flow names, entity counts, and summaries.

ParametersJSON Schema
NameRequiredDescriptionDefault
projectNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.1/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description must disclose behavior itself. It states this is a read operation that fetches data from domain-graph.json and returns a list of domains with flows, entity counts, and summaries, which covers basic behavior. However, it doesn't mention potential performance implications, error behavior for unknown projects, or any prerequisites.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is compact, using one sentence for purpose and a simple Args/Returns breakdown for the rest. There is no redundant text, and the structure is easy to scan.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description captures the core purpose, input, and output, making the tool understandable at a glance. However, it lacks usage context and enriched parameter detail, and with an output schema already available, the returns section adds little. Overall, it's sufficient for a simple overview tool but not exhaustive.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 0%, so the description must compensate for the single parameter. It only provides 'project: Project name,' which adds minimal semantic meaning beyond the schema's property name. It doesn't clarify what a project name refers to, whether it must match a specific format, or what happens if it's null.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly identifies the tool as retrieving a summary of all business domains and their flows, specifying the source file and output contents. It distinguishes itself from detail-oriented siblings by using 'overview' and 'all domains,' though it doesn't explicitly recommend against using detail tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus get_domain_detail or get_domain_flow_detail. The description does not include use cases, exclusions, or alternative tool mentions, leaving the agent to infer from the name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_graph_metadataA

Structured JSON snapshot of a project's graph state: identity, node/edge counts, graph commit, repository HEAD and freshness. Machine counterpart of get_graph_stats — parse it instead of the text output.

Args: project: Project name. Leave empty if only one project is loaded.

Returns: JSON string: {"ok": true, ...metadata} or {"ok": false, "error": {"code", "message", "remediation"}}.

ParametersJSON Schema
NameRequiredDescriptionDefault
projectNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.8/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It discloses the output format (JSON string with ok/error structure), including error code/message/remediation, and explains project handling. The 'snapshot' wording implies a read-only operation, though it does not explicitly state 'read-only' or side-effect-free. This is a minor gap but the description otherwise provides solid behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with a concise opening sentence, an Args section, and a Returns section. Every sentence adds value, with no redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with a single optional parameter and an output schema available, the description covers the return format, error handling, and parameter behavior. It even provides a usage alternative. The tool's simplicity is fully matched by the description's completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, but the description fully compensates by explaining the project parameter: 'Project name. Leave empty if only one project is loaded.' This adds meaning beyond the bare schema definition.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description states 'Structured JSON snapshot of a project's graph state' and lists specific contents: identity, node/edge counts, graph commit, repository HEAD, freshness. It also differentiates from the sibling get_graph_stats by calling it the 'Machine counterpart' and saying 'parse it instead of the text output.'

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly names get_graph_stats as the alternative and instructs to use this tool for machine parsing instead of text output. Also provides project parameter usage guidance: 'Leave empty if only one project is loaded.'

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_graph_statsB

Get comprehensive statistics about a project's knowledge graph.

Args: project: Project name. Leave empty if only one project is loaded.

Returns: Statistics: node/edge counts, type distributions, top domains, layers. Includes FRESHNESS ANALYSIS: whether the graph is up-to-date with the current codebase (uses git diff against the commit when the graph was last analyzed).

ParametersJSON Schema
NameRequiredDescriptionDefault
projectNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.3/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It does reveal an important behavior: the freshness analysis uses git diff against the commit when the graph was last analyzed, which implies a potentially expensive operation. It also lists what statistics are returned. However, it does not mention whether the tool is read-only, potential side effects, or any computational cost or rate limits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear Args and Returns sections, and it front-loads the core purpose in the first sentence. It is a bit verbose with the freshness analysis explanation, but every sentence adds value and there is no redundant fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is relatively simple with one optional parameter and an output schema exists, so the description covers the basic return contents. However, it lacks guidance on how this tool relates to siblings (especially get_graph_metadata) and does not address potential costs or operational nuances of the git diff-based freshness check. This leaves some context gaps for an agent deciding whether to invoke it.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema provides no description for the 'project' parameter (0% coverage), so the description's parameter explanation is essential. The description clearly explains that 'project' is a project name and that leaving it empty is valid when only one project is loaded, which adds meaningful semantics beyond the schema's bare type information.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's function with a specific verb ('Get') and resource ('project's knowledge graph'), and adds scope details (comprehensive statistics, freshness analysis). However, it does not distinguish itself from the sibling tool 'get_graph_metadata', which likely has overlapping functionality, so it falls short of full differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives no explicit guidance on when to use this tool versus alternatives like get_graph_metadata or query_nodes. It implies usage for statistics gathering but provides no exclusions, prerequisites, or comparative context. This leaves the agent without clear selection criteria.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_layer_infoA

List architectural layers, or get nodes belonging to a specific layer.

Args: layer_name: Layer name to inspect. Leave empty to list all layers. project: Project name.

Returns: Layer listing or nodes within a specific layer.

ParametersJSON Schema
NameRequiredDescriptionDefault
projectNo
layer_nameNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.9/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It explains the effect of layer_name (empty vs specified) and the return type (layer listing or nodes), but does not disclose behavior when project is empty or mention prerequisites, leaving some ambiguity.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a compact docstring with clear Args and Returns sections, no redundant prose, and the primary purpose is front-loaded. Every line contributes meaningfully.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has only two optional parameters and an output schema exists, but the description misses important edge-case behavior: what happens if project is left empty, and how project and layer_name interact (e.g., listing layers for a specific project). These gaps prevent full completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. layer_name is well described with a conditional behavior ('Leave empty to list all layers'), but project is only described as 'Project name,' which adds little beyond the schema title and does not clarify optionality or interaction with layer_name.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'List architectural layers, or get nodes belonging to a specific layer,' providing a specific verb and resource. This distinguishes it from sibling tools like query_nodes and get_graph_metadata by focusing on layer-level operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context on when to use the tool: listing all layers when layer_name is empty, or inspecting nodes in a specific layer. However, it does not explicitly name alternatives or state when not to use this tool, so it stops short of a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_node_detailA

Get full details of a specific node by its ID.

Args: node_id: Unique node ID (e.g., "upstream:function:src/auth/login.ts::loginUser"). Use query_nodes to find IDs. project: Project name. Leave empty if only one project.

Returns: Complete node details including path, layer, tags, complexity.

ParametersJSON Schema
NameRequiredDescriptionDefault
node_idYes
projectNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the burden. It discloses the return content ('Complete node details including path, layer, tags, complexity') and implies a read-only operation via 'Get'. However, it does not mention error behavior, authentication, or rate limits, leaving some transparency gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and well-structured with Args and Returns sections. The opening sentence states the purpose, the example adds immediate clarity, and every line contributes useful information without padding.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is relatively simple (2 parameters, output schema present), and the description covers the essential semantics, return content, and ID-finding workflow. It is complete enough for an agent to invoke correctly, though it could mention error cases or multi-project disambiguation more explicitly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has no parameter descriptions (0% coverage), but the description fully compensates: node_id is explained with a concrete example ('upstream:function:src/auth/login.ts::loginUser') and pointer to query_nodes, while project is clarified with a conditional rule. This adds significant meaning beyond the bare schema fields.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Get full details of a specific node by its ID,' which identifies the action (get), resource (node), and scope (specific node). This distinguishes it from siblings like query_nodes (search) and get_node_source (source code retrieval).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear usage context: it instructs to 'Use query_nodes to find IDs' and explains the project parameter's conditionality ('Leave empty if only one project'). It does not explicitly exclude alternatives, but it gives actionable when-to-use guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_node_sourceA

Get the actual source code for a knowledge graph node.

For function/class nodes: extracts just the method or class block with annotations. For file/config nodes: returns the whole file content (truncated if too large). Includes line numbers for easy reference.

Args: node_id: Node ID (use query_nodes to find IDs). max_lines: Max lines for whole-file reads (default 200). Does not affect function/class extraction. project: Project name.

Returns: Source code with line numbers, file path, and extraction metadata.

ParametersJSON Schema
NameRequiredDescriptionDefault
node_idYes
projectNo
max_linesNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden of transparency. It discloses node-type-specific extraction behavior, truncation for large files, inclusion of line numbers, and the effect of max_lines on whole-file reads. This is strong, but it does not mention failure modes or whether the operation is strictly read-only (though implied by 'Get'), so a 4 is appropriate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with an opening sentence, a short behavioral breakdown, labeled arguments, and a returns note. Every sentence earns its place, and the format is easy to scan without being bloated.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has 3 parameters, no annotations, no schema descriptions, and no output schema. The description covers purpose, behavior by node type, parameter semantics, and return format. It gives the agent enough context to correctly invoke the tool without needing additional lookup.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has zero parameter descriptions, so the description fully compensates. It explains node_id as an ID to be found via query_nodes, max_lines as a limit for whole-file reads that does not affect function/class extraction, and project as the project name. This adds significant meaning beyond the raw schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource: 'Get the actual source code for a knowledge graph node.' It further distinguishes behavior for function/class vs file/config nodes, which clearly separates it from sibling tools like get_node_detail or query_nodes that serve different purposes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Clear context is provided: use this tool when you need the actual source code for a node. The description also tells the agent to use query_nodes to find IDs, which is a helpful cross-reference. However, it does not explicitly mention when to avoid this tool or name alternative tools for metadata-only needs, so it falls short of a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_relationshipsA

Get all nodes connected to a given node, with relationship types.

Args: node_id: Node ID to inspect. direction: "out" (this node calls/imports others), "in" (others call/import this), "both". relation_filter: Filter by relation: "calls", "imports", "contains", "implements", "extends". Leave empty for all. project: Project name.

Returns: List of relationships in format: "source --[relation]--> target".

ParametersJSON Schema
NameRequiredDescriptionDefault
node_idYes
projectNo
directionNoboth
relation_filterNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden. It does well by explaining direction semantics (e.g., 'out' means this node calls/imports others) and enumerating valid relation_filter values, which adds behavioral context beyond the bare schema. Yet it does not explicitly state that this returns only direct/first-degree relationships, nor mention any limits like pagination, so it is not fully transparent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is efficiently organized: a one-sentence summary, then a clear argument list with inline documentation, and a return format specification. There is no filler or repetition. All content is purposeful and easy to scan.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (4 params, 1 required, no annotations), the description covers parameters, direction semantics, and return format. It omits edge-case behavior such as invalid node IDs or empty results, and does not explicitly state this is a read-only operation, but the 'Get' wording implies it. Overall, it is sufficient for an agent to use correctly in most cases.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must fully compensate. It does: every parameter (node_id, direction, relation_filter, project) is documented with its meaning and allowed values. Direction and relation_filter get particularly thorough explanation, covering all enum-like options. This far exceeds what the schema provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Get all nodes connected to a given node, with relationship types.' The verb 'get' is specific, the resource (connected nodes with relationship types) is explicit, and the scope (direct relationships) is implied by the direction parameter semantics. This distinguishes it from sibling tools like find_path or trace_call_chain, which explore larger structures.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when the tool is appropriate (inspecting a node's direct connections) through its parameter explanations. However, it does not explicitly state when not to use it or mention alternative tools, such as find_path for paths or trace_call_chain for call chains. This meets the 'clear context' bar but lacks explicit exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_tourA

Get the guided project tour — a curated walkthrough of the most important parts of the codebase.

Tour stops are ordered sequences that explain the project's key components, each linking to specific nodes in the knowledge graph.

Args: stop_index: Specific tour stop number (1-based) to expand with full node details. Leave empty to list all stops. project: Project name.

Returns: Tour overview or detailed stop with linked nodes.

ParametersJSON Schema
NameRequiredDescriptionDefault
projectNo
stop_indexNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden. It discloses useful behavioral details: tour stops are ordered sequences linking to knowledge graph nodes, stop_index is 1-based, and leaving it empty lists all stops while specifying expands with full node details. It also states the return format, providing good transparency for a read-only tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is succinct: a two-sentence intro followed by structured Args and Returns sections. Every sentence adds value—defining the tour concept, explaining the parameter behaviors, and outlining return types. No fluff or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple with only two optional parameters, and an output schema exists, so return values are covered. The description explains the core behavior well. However, it lacks any mention of prerequisites, project selection context, or edge cases, which would make it more complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema provides no descriptions for the two parameters (0% coverage). The description compensates well by explaining stop_index as a 1-based number with a specific behavior when empty, and project as the project name. This adds meaning beyond the schema, though it could clarify what happens when project is omitted (default null).

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool retrieves a guided project tour—a curated walkthrough of important codebase parts. The verb 'get' and resource 'tour' are specific, and this distinguishes it from sibling graph/query tools like query_nodes or get_domain_overview.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives clear context for when to use this tool: when you want a high-level curated overview or a detailed stop. It explains the stop_index behavior (empty to list all, specify to expand), but does not explicitly mention alternatives or exclusion conditions among the many sibling tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_projectsA

List all registered projects with basic statistics.

No parameters required. Call this first to see available projects.

Returns: List of projects with node/edge counts and domain info.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.3/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It states that no parameters are required and that it returns node/edge counts and domain info, implying a safe, read-only list operation. However, it does not disclose any potential caveats like pagination, data freshness, or whether projects can be empty, so it only meets the basic standard.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is three short sentences, each serving a clear purpose: describing the function, noting the lack of parameters, and stating the return value. There is no wasted wording or redundancy, and the main action is front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple tool with no parameters and an existing output schema, the description is complete. It tells the agent when to call it (first), what it does, and what it returns, which is sufficient to decide when and how to invoke it.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has zero parameters, and the description explicitly says 'No parameters required.' With no parameters to explain, the baseline for a 0-parameter schema is 4, and the description appropriately adds no unnecessary detail.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description begins with 'List all registered projects with basic statistics,' clearly stating a specific action and resource. It also notes that this should be called first, which distinguishes it from sibling tools by positioning it as the entry point to discover projects.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit guidance to 'Call this first to see available projects,' indicating this is the initial contact point. It implies that the agent should use this before exploring graph-specific tools, but it does not name alternatives or exclusion criteria, so it lacks the explicit when-not-to-use guidance for a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

query_nodesA

Search for nodes in the knowledge graph by keyword (weighted fuzzy matching).

Scoring: name (3x weight) > summary (1.5x) > tags (1x). Exact name matches get a bonus. Supports pagination via offset/limit.

Args: query: Search keyword (e.g., "authentication", "login", "PaymentService"). node_type: Filter by type: "file", "function", "class", "config", "service". Leave empty for all. limit: Max results per page (default 10). offset: Starting offset for pagination (default 0). Use with limit for paging. project: Project name. Leave empty if only one project.

Returns: List of matching nodes with id, type, name, summary, layer, and tags.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo
queryYes
offsetNo
projectNo
node_typeNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description fully carries behavioral disclosure. It reveals weighted scoring, exact-match bonuses, and pagination support. It stops short of detailing ordering or empty-result behavior, but provides substantial insight into the tool's behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is tightly structured, with a one-sentence summary, scoring details, and a bulleted argument list. Every sentence serves a purpose without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite having an output schema (which could reduce the need to explain returns), the description still lists the return fields. It covers query syntax, filtering, pagination, and project scoping, making it self-sufficient for an agent to invoke the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, but the description compensates fully by explaining each parameter with examples and defaults. It adds meaning beyond the schema types by describing 'node_type' filtering, pagination, and project context.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description specifies the action ('Search for nodes') and the resource ('knowledge graph'), with a clear keyword-based scope. It distinguishes itself from siblings like search_by_file_path by mentioning weighted fuzzy matching and scoring.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description clearly explains the kind of search (keyword-based, fuzzy matching) and how scoring works, which implies when to use it. However, it does not explicitly mention alternatives or exclusion cases, so it lacks explicit 'when not to use' guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_by_file_pathA

Find nodes by file path pattern (substring match).

Useful for finding all nodes in a package, module, or directory. Case-insensitive.

Args: path_pattern: Substring to match in file paths (e.g., "payroll", "com/vietbank/sme", "auth"). node_type: Optional filter by type: "file", "function", "class". Leave empty for all. limit: Max results (default 30, max 50). project: Project name.

Returns: List of matching nodes sorted by file path.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo
projectNo
node_typeNo
path_patternYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.1/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden for behavioral disclosure. It specifies substring matching, case-insensitive behavior, sorting by file path, and result limits (max 50), which are valuable beyond the schema. It does not explicitly note that the operation is read-only, but the search nature implies it.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is compact yet complete: a clear purpose sentence, a usage hint, and organized Args/Returns sections. Each sentence adds value, and the structure makes parameters and return value easy to scan.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the 4-parameter tool with an output schema, the description covers all parameters, return type, and sorting behavior. It could also mention behavior for invalid inputs or empty results, but the description is otherwise comprehensive.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema provides only parameter names and types with no descriptions (0% coverage). The description compensates by explaining path_pattern with examples, node_type allowed values, limit constraints (default 30, max 50), and project semantics, adding significant meaning beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool finds nodes by file path pattern using substring matching, providing a specific verb and resource. It gives usage context for locating nodes in packages/modules/directories, but it does not explicitly distinguish from sibling search tools like query_nodes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides a clear use case ('finding all nodes in a package, module, or directory') and adds matching semantics, but it lacks explicit guidance on when not to use this tool or references to alternative sibling tools for other search criteria.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

trace_call_chainA

Trace the function call chain starting from a node (BFS on 'calls' edges).

For class/file nodes: automatically resolves to contained functions and traces call chains from them.

Args: start_node_id: ID of the starting node (function, class, or file). max_depth: Max traversal depth (default 3, max 10). project: Project name.

Returns: Call tree as indented text.

ParametersJSON Schema
NameRequiredDescriptionDefault
projectNo
max_depthNo
start_node_idYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden of behavioral disclosure. It reveals that traversal is BFS-based, that class/file nodes are automatically resolved to functions, and that output is an indented text tree. It also documents max_depth limits. While it doesn't discuss auth or destructive behavior (unnecessary for a read-only trace), it provides substantive algorithmic details beyond the tool's name.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with a brief purpose statement, followed by Args and Returns sections. Every sentence adds value—there is no fluff. The front-loaded purpose sentence immediately communicates the core function, and the parameter details are formatted for easy parsing.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (graph traversal with special node-type handling), the description is complete. It covers the algorithm, input parameters with defaults, special cases for class/file nodes, and the return format. Despite an output schema existing, the description's note that the result is 'indented text' is sufficient for an agent to understand the outcome. No critical context is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has 0% description coverage, so the description must fully compensate. It does: an Args section explains each parameter (start_node_id, max_depth, project) with types, defaults, and constraints (e.g., max_depth default 3, max 10). This greatly exceeds the bare schema definitions, providing clear semantics for all three parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's function: 'Trace the function call chain starting from a node (BFS on 'calls' edges).' It uses a specific verb ('trace') and resource ('function call chain'), and specifies the algorithm (BFS on calls edges). This distinguishes it from sibling tools like find_path or find_impact, which focus on different types of graph traversal.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage by explaining how it handles different node types and parameters, but it does not explicitly state when to use this tool versus alternatives. There are no direct comparisons or exclusions (e.g., 'for impact analysis use find_impact'). Guidance is implied but not definitive.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 18 tool updatesv0.2.1
    • First observedfind_entry_points
    • First observedfind_impact
    • First observedfind_path
    • First observedget_class_hierarchy
    • First observedget_domain_detail
    • First observedget_domain_flow_detail
    • First observedget_domain_overview
    • First observedget_graph_metadata
    • First observedget_graph_stats
    • First observedget_layer_info
    • First observedget_node_detail
    • First observedget_node_source
    • First observedget_relationships
    • First observedget_tour
    • First observedlist_projects
    • First observedquery_nodes
    • First observedsearch_by_file_path
    • First observedtrace_call_chain

TDQS

A4.1/5.0
Disambiguation5/5

Each tool targets a distinct aspect of the knowledge graph (entry points, stats, node search/detail/source, relationships, layers, domains, flows, impact, paths, hierarchy, file path). The two stats tools are clearly separated by intended audience (human-readable vs machine-readable), so there is no meaningful overlap.

Naming Consistency5/5

All tool names follow an imperative verb_noun pattern (find_, get_, list_, query_, trace_, search_). The consistent use of snake_case and a predictable verb prefix makes the toolset easy to navigate.

Tool Count4/5

18 tools is slightly above the ideal range, but each tool serves a distinct query need for a code understanding server. The count is justifiable given the breadth of analysis features, though it borders on heavy.

Completeness5/5

The toolset covers the full lifecycle of codebase exploration: listing projects, searching and inspecting nodes, retrieving source, tracing relationships and call chains, analyzing impact, exploring layers and business domains, and getting guided tours. No obvious gaps for the stated purpose.

Maintenance

ActivityMaintained
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • F
    license
    C
    quality
    D
    maintenance
    Enables AI assistants to analyze codebases through semantic search, call graph generation, and function metadata extraction. Provides real-time code analysis with persistent vector storage for understanding complex code structures and relationships.
    13
    6
    -
  • F
    license
    B
    quality
    Not graded
    maintenance
    Provides comprehensive codebase analysis and semantic understanding through integrated knowledge graphs, enabling AI assistants to understand project structure, patterns, dependencies, and context through multiple analysis tools and format generators.
    9
    -
  • A
    license
    Not graded
    quality
    B
    maintenance
    Provides AI coding assistants with deep, semantic understanding of local codebases via AST-aware chunking, cross-repo symbol graphs, and architectural memory, enabling context-aware code search and dependency tracing.
    10
    MIT

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/VIethoangnguyenle/Understand-Anything-MCP'

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