Multi-language code graph generator for C/C++/Go/Python/Java/Rust/ASM — invocation graphs, conditional paths, concurrency analysis, data flow, FFI tracing, dual memory/brief knowledge stores, and an 83-tool MCP server.
Code2Database exposes 27 tools with generally clear naming (verb_noun pattern: code2database_load, cgdb_search_symbols, etc.) and reasonable descriptions (avg ~120 chars). However, critical gaps emerge: 15 tools lack documented output schemas entirely; parameter descriptions are sparse or missing for complex inputs (e.g., cgdb_find_invokers accepts edge_types array with no enum or format guidance); error handling is absent (no recovery guidance, no actionable error messages visible in code); and several tools expose internal database IDs (node_id, file_id, token_id) without accepting human-friendly names. The WRITE/IRREVERSIBLE tools (edit_token, commit_db_transaction, delete_node) lack confirmation patterns or dry-run support. Composition is reasonable, tools chain via IDs, but the interface prioritizes database internals over user intent.
Add a new function node with the given signature and body tokens.
Find CFG paths from entry to exit in a function.
Find callees of a node (recursive CTE). When include_vtable_dispatch=true, also resolves vtable dispatch via ops_bindings.
Find callers of a node (recursive CTE with cycle protection). When include_vtable_dispatch=true, also follows indirect dispatch via ops_bindings + invoke_sites tables.
Find functions bound to a vtable field (e.g., file_operations.read_iter).
Find type definitions (struct/union/enum/typedef) by name.
Find definition nodes by name (function/var/field/typedef).
Return the function body source text for a function (name or id).
Output schemas undocumented for 15+ tools. LLMs cannot plan downstream calls or extract required fields (e.g., cgdb_find_invokers returns what? A list of node IDs? Full node objects?). Violates pattern:tool and pattern:response-shaper.
WRITE/IRREVERSIBLE tools (edit_token, commit_db_transaction, delete_node, add_function) lack confirmation or dry-run patterns. Agents can destructively modify code without safeguards. Violates pattern:confirmation-request.
Inferred effective spec: 2026-07-28+.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | F | 46 | 2026-07-28+ | v2 |
Return the source text for a node, with byte-precise attribution. Resolution order: source_snippet column → file read via byte_start..byte_end.
Return a struct/union's field layout.
Full-text search over cgdb_nodes via FTS5.
Describe a node with optional detail levels (brief, standard, full).
One-shot context retrieval by query.
Load and summarize the invocation graph. For large SQLite-backed graphs, uses SQL counts instead of iterating all nodes in Python.
Search nodes by keywords. For large SQLite-backed graphs, uses SQL LIKE on functions table instead of iterating all nodes in Python.
Commit a pending DB transaction: render + clang-format + compile + lint + sha256 verify + write to disk + (optional) git commit. Rolls back on any failure.
Delete an AST node by ast_node_id (DB only — commit to write).
Delete a token by token_id (DB only — commit to write).
edit_token(token_id, new_text) -> {affected_nodes, transaction_id}
Find macros by name (or list all if no name).
Get #if/#ifdef/#elif branches for a file_id.
Find string literals matching a regex pattern.
Insert a new AST node after the given anchor ast_node_id.
insert_token(after_token_id, tokens[]) -> {new_token_ids, transaction_id}
render_source(file_id) -> {content, sha256, matches_disk}
Roll back a pending DB transaction (undo DB-side edits).
verify_consistency(file_id) -> {db_sha256, disk_sha256, ok, diff}
Tools expose internal database IDs (node_id, file_id, token_id, ast_node_id) as required parameters without accepting human-friendly names (function name, file path). Forces agents to perform extra lookup calls. Violates pattern:natural-identifiers and mxe:chat-data-model.
Parameter descriptions missing or vague for complex inputs. cgdb_find_invokers.edge_types is an array with no enum, format, or example. cgdb_get_source.context_bytes has no guidance on typical values. Violates pattern:constrained-input and pattern:tool-description.
No error handling guidance visible in code. Tools return raw database errors or stack traces instead of actionable recovery hints (e.g., 'Node not found. Try cgdb_search_symbols() first.'). Violates pattern:recovery-guide and pattern:error-classification.