fw-context-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Capabilities
Features and capabilities supported by this server
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| check_ollamaA | Check whether Ollama is running and the configured embedding/chat model is installed. Read-only: yes. No side effects. Call before smart_search, semantic_search, or explain_symbol (when on-demand fallback is expected — pre-computed analysis returns instantly without Ollama). Returns: dict: {ollama_enabled (bool), status (str — "ok"|"disabled"|"error"|"model_missing"), ollama_running (bool), ollama_url (str), configured_model (str), num_ctx (int), installed_models (list[str]), configured_embed_model (str), embedding_installed (bool), message (str, on error/disabled), available_code_models (list[str], when model missing), debug_log (str, optional — only when debug logging is enabled)} |
| get_active_buildA | Return metadata about the most recently indexed build configuration. Read-only: yes. Call at session start to check if the index exists, how many symbols it contains, and whether it is stale (needs re-index).
When Returns: dict: {config_hash, project_id, project_root, build_system, compile_commands, indexed_at (ISO timestamp), symbol_count, file_count, reference_count, modified_files_count (int), analyzed_symbols (int), unanalyzed_symbols (int — definition symbols still needing LLM analysis), analysis_model (str or None), bg_reindex_running (bool), reindex_progress (str or None — last log line when reindex is running), schema_version (int — DB schema version), current_schema (int — code expects), stale (bool — any staleness condition)} |
| list_projectsA | List all indexed firmware projects with their statistics. Read-only. No side effects. Use at session start to discover available
projects; use Returns: list of dicts, each with: project_id, name, root_path, build_system, symbol_count, file_count, indexed_at, schema_version, current_schema, stale (bool), db (path to SQLite database file). |
| reindex_fileA | Re-parse a single source file with libclang and update its symbols in the index. Not read-only — uses the exact compiler flags from Also regenerates LLM analysis and method override relationships for affected symbols when those features are enabled in config. Args: file_path: Path to source file to re-parse. Must be in compile_commands.json. project_root: Project root directory. Auto-detected if omitted. Returns: dict: {file, translation_units, symbols_updated, elapsed_s, analysis_updated (if LLM enabled), or error}. |
| reindex_file_implA | Re-parse a single source file with libclang and update its symbols in the index. Shared implementation used by Requires an existing index ( Args: file_path: Absolute or project-relative path to the source file to re-parse. Must have a matching entry in compile_commands.json. project_root: Project root directory. Auto-detected from cwd if omitted. with_analysis: When True (default), also regenerates LLM symbol analysis, file-level summaries, and method override relationships — slower but produces a fully up-to-date index. Set to False for a fast symbol-only update (used by background auto-reindex). Returns:
On success — dict with keys:
file (str): Resolved absolute path to the re-indexed file.
translation_units (int): Number of TUs that include this file.
symbols_updated (int): Number of symbols written/updated.
elapsed_s (float): Parse + store time in seconds.
analysis_updated (int, optional): Symbol count with fresh LLM
analysis (only present when LLM analysis is enabled and
with_analysis=True).
analysis_warning (str, optional): Reason LLM analysis was skipped.
overrides_warning (str, optional): Reason override analysis was skipped.
warning (str, optional): Header re-indexed via a single TU — other
TUs including this header may still have stale symbols; run
|
| reset_indexA | Delete the entire symbol index for a project. Not read-only — permanently deletes the SQLite database and WAL files.
Call with Handles corrupt databases gracefully — you can delete a corrupt index without needing to open it first. Args: project_root: Project root directory. Auto-detected if omitted. confirm: Must be True to execute. Call without first as dry-run. Returns: dict: {project_root, db, project_id, action: "dry_run"|"deleted", message, symbol_count, indexed_at (dry-run)}. |
| lookup_symbolA | Look up a symbol by name — exact or prefix matching. Returns all declarations and definitions matching the name across the
entire indexed codebase. Prefer this over search_code when you know the
exact symbol name or a prefix of it ( Read-only: yes. May auto-reindex stale files (non-blocking). Args: name: Symbol name (exact match) or prefix (set exact=False). E.g. 'uart_init' finds the exact function; 'uart_' finds all symbols starting with 'uart_'. project_root: Project directory. Auto-detected if omitted. exact: True = exact name match, False = prefix LIKE match (default). limit: Maximum results (default 50). Returns:
list[dict]: Symbols with name, qualified_name, kind, file, line,
signature, docstring, is_definition, is_template, is_virtual,
is_pure_virtual fields. Enum constants include |
| search_codeA | Full-text search over indexed C/C++ symbols (functions, classes, methods, enums, etc.). Read-only. No side effects. Use when looking for symbols by topic or keyword
rather than exact name. Prefer FTS5 syntax:
Progressive relaxation: when the initial FTS5 search returns nothing, the tool automatically broadens the search in up to five steps:
Results from fallback steps carry Kind filter values: Each result may include Args: query: Search term(s) with FTS5 syntax. Keep queries short — 1–3 words. project_root: Project root directory. Auto-detected from CWD if omitted. kind: Optional filter to return only symbols of this kind. limit: Maximum number of results (default 20, max 100). Returns:
list of dicts, each with: name, qualified_name, kind, file, line,
is_definition, signature, docstring, is_template, is_virtual,
is_pure_virtual. Enum constants include |
| semantic_searchA | Read-only. Semantic search using pre-computed symbol embeddings. Finds symbols conceptually related to a natural-language query, even when
the query words don't appear literally in the code. Uses cosine similarity
over 1024-dimensional embeddings generated during When to prefer over search_code: When you're describing a concept rather than searching for a known keyword. Examples:
When to prefer search_code instead: When you know the exact keyword
or symbol name ( Threshold guidance (mxbai-embed-large model):
Source-aware ranking: Project code ( Requires Ollama with an embedding model ( Args: query: Natural language description of what you're looking for. Be specific — 5–15 words works best. project_root: Project root. Auto-detected if omitted. threshold: Minimum cosine similarity (0.0-1.0). Default 0.60. limit: Maximum number of results (default 20, max 100). Returns:
list of dicts, each with: name, qualified_name, kind, file, line,
is_definition, signature, docstring, plus |
| smart_searchA | Natural-language search: Ollama generates FTS5 keywords, then searches the index. Read-only. No side effects. Slow (10-30 s) — delegates to the full
Multi-phase approach:
When to prefer over search_code: When you don't know the exact keywords and want to describe what you're looking for ("how does the modem connect?", "handle BLE pairing failure"). Fallback: When Ollama is unavailable, falls back to direct FTS5 search with word-split terms from the query. Args: query: Natural language description of what you're looking for. Be specific — 5–15 words works best. project_root: Project root directory. Auto-detected from CWD if omitted. limit: Maximum number of results (default 20, max 100). Returns: list of dicts with metadata entries (_generated_queries, _rough_queries, _translated_from) followed by symbol results with name, qualified_name, kind, file, line, is_definition, signature, docstring. |
| find_all_callers_recursiveA | Read-only. Find all transitive callers — who calls name, directly or indirectly. Use for impact analysis: "if I change this function, how far does the
ripple go?" Returns callers at depth 1 (direct), depth 2 (callers of
callers), up to For a flat, single-level caller list use |
| find_call_pathA | Read-only. Find call paths between two functions via BFS in the call graph. Use to answer "how does A reach B?" — e.g. tracing how a high-level
event handler eventually calls a low-level driver. Returns up to 5
shortest paths, each with For one-sided exploration use |
| find_callees_recursiveA | Read-only. Find all transitive callees — what name calls, directly or indirectly. Use for dependency analysis: "what does this function depend on to do
its job?" Returns callees at depth 1 (direct), depth 2 (callees of
callees), up to For direct callees only, |
| find_callersA | Read-only. Find call sites of a function/method — who calls Use when you need a quick, flat list of immediate callers. For the full
transitive call tree (who calls this indirectly through other functions),
use Requires the reference index ( Indirect edges (
Args:
name: Symbol name to find callers of. Uses the same three-tier
resolution as Returns:
list of dicts, each with: file, line, ref_kind ( |
| find_dead_codeA | Read-only. Find functions/methods that are defined but never called. Returns two categories of results, each with a
Expect additional false positives from constructors called via factories, ISRs, virtual method overrides, and weak-aliased symbols. Always verify before deleting. By default, SDK/vendor paths are auto-excluded based on the build system (mbed-os/ for Mbed OS, .pio/ for PlatformIO, zephyr/ + build/
|
| find_hotspotsA | Read-only. Find the most-called functions ranked by caller count. Use for high-level impact assessment: changing a hotspot affects many call sites. The result tells you which functions carry the most "architectural weight" — good targets for refactoring, optimization, or extra testing. By default, SDK/vendor paths are auto-excluded. Use Requires the reference index ( |
| find_indirect_call_sitesA | Find indirect call sites where a function pointer field or variable is invoked. Returns locations where a function pointer is called through a field
access ( Read-only. No side effects. Use this to answer "where is this function
pointer invoked?" as opposed to For the reverse query — which functions are assigned to a given field
or parameter — use Requires the reference index ( Args:
name: Name of the function pointer field or variable.
E.g. Returns:
list of dicts, each with: file, line, expr_text (the callee
expression, e.g. |
| find_indirect_targetsA | Read-only. Find functions assigned to a function pointer field or variable. Links assignment sites ( Returns each function that could be invoked through the named function
pointer, showing both the assignment location and the call site(s).
When a function is assigned but no call site is found, For the reverse query — where is this field or parameter called — use
Read-only. No side effects. Requires the reference index
( Args:
name: Name of the function pointer field, variable, or parameter.
E.g. Returns: list of dicts, each with: rhs_name (assigned function), rhs_qname, fn_ptr_type, method (assignment/call_arg/var_init/ init_list), assign_file, assign_line, assign_caller, call_file, call_line, call_expr_text. |
| find_referencesA | Find all references to a symbol — calls, reads, and member accesses. Read-only. No side effects. Returns every reference in the indexed codebase,
including call sites, variable reads, struct member accesses, and indirect
function-pointer references. Requires the reference index
( For direct callers only use Args: name: Symbol name to find all references of. project_root: Project root directory. Auto-detected if omitted. limit: Maximum results (default 50, max 200). Returns:
list of dicts, each with: file, line, ref_kind, caller, caller_kind.
|
| find_wrapper_callersA | Read-only. Find wrapper classes that call methods of a driver class. Returns wrapper methods grouped by wrapper class, showing which driver
methods each wrapper calls. Useful for understanding the adapter/wrapper
architecture (e.g. |
| trace_data_flowA | Read-only. Trace how data of a given type flows to a target function. Finds functions whose signature mentions type_name, then looks for call paths from those functions to to_symbol. Returns a data flow map — useful for understanding how a data structure travels through the system to its destination. Works best for synchronous driver stacks (e.g. sensor read → I2C write).
Cannot follow async flows (message queues, interrupts, RS485 callbacks).
For exact call-graph queries use the |
| explain_symbolA | Explain what a C/C++ symbol does in plain English. Read-only. No side effects — uses pre-computed LLM analysis when available
(instant, generated during For raw source code use Args:
name: Symbol name to explain. E.g. Returns: dict: {name, kind, file, line, signature, explanation, llm_analysis (if pre-computed)}, plus source/explain_prompt on fallback. |
| get_file_analysisA | Return the file-level LLM analysis summary for a source file. Read-only: yes. No side effects. Returns the pre-computed 2-3 sentence
summary describing what the file is responsible for. Generated during
Returns |
| get_file_mapA | Return all symbols in a file grouped by kind — fast structural overview. Like a table of contents before reading a chapter. Pass a path relative
to the project root ( Enum constants ( Read-only: yes. No side effects. Use before reading a large file to orient yourself — see what functions, classes, and enums it defines. Args: file_path: Path relative to project root, or just the filename. project_root: Project directory. Auto-detected if omitted. signatures: Include full function signatures. Default: False. max_per_kind: Max items per kind group (default 30, 0 = unlimited). Returns: dict: {file, total_symbols, symbols: {kind: {count, items[], subgroups?[]}}, file_summary (str, optional — file-level LLM analysis summary when available)} |
| get_sourceA | Read-only. Preferred way to read a function/method/enum body — uses libclang for exact extents instead of guessing from line numbers. No LLM, fast. For enums, includes a For rich context (who calls this, what does it call) use get_symbol_context instead. For the full file, use a normal file read. Returns:
dict: {name, qualified_name, kind, file, line, signature,
is_definition, is_template, is_virtual, is_pure_virtual,
source (str — the function/enum body, truncated at 8000 chars),
warning (str, optional — when source file cannot be read)}.
May also include |
| get_symbol_contextA | Read-only. Rich one-shot context for a symbol: body, signature, all direct callers and callees. Answers "what does this do and how does it fit in the system?" in a single response. For body-only use get_source (faster). For transitive call-graph exploration use find_all_callers_recursive or find_callees_recursive. By default, SDK/vendor callers and callees are filtered out for clarity.
Use Returns dict with: name, qualified_name, kind, file, line, signature,
is_definition, callers (list), callees (list), source (body text),
indirect_call_sites (list, for field/variable symbols — where the
function pointer is actually invoked).
For field and variable symbols that have function pointer type,
also includes |
| get_class_membersA | Read-only. Return all methods, fields, and nested types of a class/struct. Members are grouped by kind (method, constructor, destructor, field, enum, typedef, class, struct). Each member includes its signature, virtual flags, and source line. Works for C structs too — they just won't have methods. Returns: dict: {name, qualified_name, kind, file, line, members: {kind: [...]}, member_count} |
| get_inheritance_chainA | Read-only. Return the C++ inheritance chain for a class or struct. Shows direct base classes (what this inherits from) and direct derived classes (what inherits from this), along with access level and virtual flag for each edge. When Returns: dict: { name, qualified_name, kind, file, line, bases: [{name, usr, access, is_virtual, file}], derived: [{name, usr, access, is_virtual, file}], all_bases: [...] (when transitive=True, ancestors sorted by depth), all_derived: [...] (when transitive=True, descendants sorted by depth) } |
| get_method_overridesA | Read-only. Return virtual method override information. Shows what base-class method this method overrides, and what derived-class
methods override this one. Built from the For class-level inheritance, use Returns: dict: { name, qualified_name, kind, file, line, signature, overrides: [{usr, name, qualified_name, kind, file, line}], overridden_by: [{usr, name, qualified_name, kind, file, line}] } |
| get_template_instancesA | Read-only. Find all template instantiations for a given class or function template. Returns concrete instantiations of the template — each with its full type
signature (e.g. Uses the Returns: list[dict] with one element wrapping the template declaration: {name, qualified_name, kind, file, line, is_definition, signature, instances (list of dicts, each with name, qualified_name, kind, file, line, signature, is_definition), instance_count (int)} |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| resource_stats | Return a human-readable markdown summary of all indexed projects. Read-only. Aggregates stats from every project database found under the configured index directory. |
| resource_projects | Return project list as a JSON string. Read-only. Uses the same data as ``list_projects``, serialized as indented JSON. |
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/turbyho/fw-context-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server