Grafyx

v0.2.4
io.github.bilal07karadeniz/grafyx Checked 1 day ago Published 4 months ago

Real-time codebase graph for AI assistants: call graphs, dependencies, symbol lookup.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

get_project_skeleton

Get the full project structure with file tree and statistics. Call this first when starting work on a project to understand its overall shape, module layout, and code distribution.

ParameterTypeDescription
detailstringLevel of detail: - ``"signatures"``: compact overview — totals, languages, and ``top_files`` (15 most code-dense files). Drops the file tree, directory stats, and per-language breakdown. Use w…
include_hintsbooleanIf True, append navigation suggestions.
max_depthintegerMaximum depth for the file tree display.

get_function_context

Get comprehensive context for a function: signature, parameters, callers, callees, dependencies, and docstring. Supports 'ClassName.method_name' syntax (e.g., 'ToolExecutor.execute'). For two top-level functions sharing the same name in different files (where ``ClassName.method`` doesn't apply), pass ``file_path`` to pick one. If multiple matches remain, returns a disambiguation list. Use this when you need to understand what a function does, who calls it, and what its blast radius is for modifications.

ParameterTypeDescription
function_name *stringName of the function to look up.
detailstringLevel of detail: "signatures", "summary" (default), or "full".
file_pathstringOptional path filter to disambiguate same-named top-level functions in different files. Matched by substring against each candidate's filepath, so a partial path like ``"api/agents.py"`` is enough.
include_hintsbooleanIf True, append navigation suggestions.

get_file_context

Get comprehensive context for a file: functions, classes, imports, and relationships to other files. Use this when you need to understand what a file contains and how it connects to the rest of the codebase.

ParameterTypeDescription
file_path *stringPath to the file to inspect.
detailstringLevel of detail: "signatures", "summary" (default), or "full".
include_hintsbooleanIf True, append navigation suggestions.

get_class_context

Get comprehensive context for a class: methods, properties, inheritance chain, and usages throughout the codebase. Use this when you need to understand a class's interface and where it is used.

ParameterTypeDescription
class_name *stringName of the class to look up.
detailstringLevel of detail: "signatures", "summary" (default), or "full".
include_hintsbooleanIf True, append navigation suggestions.

get_module_context

Get an overview of all symbols in a directory/package. This is the intermediate zoom level between get_project_skeleton (whole project) and get_file_context (single file). Use it to understand what a package contains before drilling into specifics.

ParameterTypeDescription
detailstringLevel of detail: "signatures", "summary" (default), or "full".
include_hintsbooleanIf True, append navigation suggestions.
limitintegerMaximum number of files to return (0 = no limit, default). Combine with offset to page through modules with hundreds of files where the response would otherwise be truncated. ``total_files`` in the re…
module_pathstringDirectory path relative to project root (e.g. "services", "grafyx/graph"). Empty string means the whole project.
offsetintegerNumber of files to skip (for paginating large modules).

get_dependency_graph

Get the dependency graph for a symbol: what it depends ON and what depends on IT, up to the specified depth. Use this to understand the impact radius of changing a symbol.

ParameterTypeDescription
symbol_name *string
depthinteger

get_call_graph

Get the call graph for a function: what it calls and what calls it, recursively up to the specified depth. Supports 'ClassName.method_name' syntax (e.g., 'SkillManager.initialize'). If multiple functions share the same name, returns a disambiguation list. Use this to trace execution flow and understand how a function fits into the larger call chain. By default, Python builtins and common stdlib methods (len, append, strip, etc.) are filtered out for clarity. Set include_builtins=True to see everything.

ParameterTypeDescription
function_name *string
depthinteger
include_builtinsboolean

set_project

Set or change the project directory that Grafyx analyzes. Call this when Grafyx reports 'No project loaded' — typically when running as a global MCP server. Pass the workspace root path. After calling this, all other Grafyx tools will work on the specified project. Re-call with a different path to switch projects.

ParameterTypeDescription
project_path *stringAbsolute path to the project root directory.

get_conventions

Detect and report coding conventions used in this codebase. Use this to understand the project's style BEFORE writing new code, so your additions are consistent with existing patterns.

refresh_graph

Bring the codebase graph up to date with the code on disk. Use this after making changes to the codebase, or if the graph seems stale. On mirrored (Windows-mount) projects the mirror is re-synced first and only the changed files are re-parsed (incremental, ~seconds); a full re-parse runs only when the change set can't be determined. Normally the file watcher handles this automatically on native projects.

get_unused_symbols

Find functions and classes with zero inbound references (dead code detection). Analyzes the caller index and import graph to identify symbols that are never called, subclassed, or referenced from other code. Excludes common false positives: dunder methods, framework-decorated handlers, entry points, and exception classes.

ParameterTypeDescription
include_testsbooleanIf True, also scan test files for unused code.
max_resultsintegerMaximum results per category.
symbol_typestringWhat to search for: "all", "functions", or "classes".

get_subclasses

Find all classes that extend a given class, recursively. Use this to understand the impact of changing a class's interface: which subclasses would need updating? Supports multi-level inheritance trees up to the specified depth. When the codebase has multiple classes sharing ``class_name`` (e.g. Django defines ``Field`` in both ``contrib/gis/gdal/field.py`` and ``db/models/fields/__init__.py``), pass ``file_path`` to pick the intended definition. Without it, the first match wins and the response includes ``ambiguous: True`` plus a ``candidates`` list so you can retry.

ParameterTypeDescription
class_name *stringName of the base class to find subclasses of.
depthintegerHow many inheritance levels to traverse (1 = direct only).
file_pathstringWhen ambiguous, pick the definition in this file. Substring match is NOT done — pass the exact path Grafyx reports in the ``candidates`` list of an ambiguous response.