Static source inference · medium confidence · detected: Logging
Deprecated protocol patterns detected
Summary
The Knowledge Graph MCP server defines 4 tools with comprehensive input schemas and descriptions. Tool naming follows verb_noun convention (add_memory, search_memory, analyze_patterns, manage_graph), which is appropriate. All tools have detailed parameter schemas with enums and descriptions. However, output schemas are not documented in the provided source, and some descriptions lack clarity on state-modifying consequences. Tool composition is reasonable but could benefit from clearer separation of concerns, particularly in manage_graph which combines multiple unrelated operations (delete_node, delete_edge, delete_group, get_statistics, export_subgraph, clear_cache, optimize_storage, vacuum_database).
manage_graph tool violates single-responsibility principle by combining 8 unrelated operations (delete_node, delete_edge, delete_group, get_statistics, export_subgraph, clear_cache, optimize_storage, vacuum_database) in one tool. LLMs cannot reason clearly about which operation to select for a given intent.
Output schemas not documented for any of the 4 tools. LLMs cannot predict what fields will be returned, which breaks downstream tool chaining and forces agents to make assumptions about response structure.
add_memory and manage_graph (delete_* operations) are state-modifying tools but descriptions do not explicitly state they modify state or clarify idempotency/safety for retry. Error handling for irreversible operations (delete_node, delete_edge, delete_group) lacks confirmation/dry-run pattern.
mcp_kg-mcp-server_add_memory
Recommendations
Split manage_graph into separate tools: delete_node, delete_edge, delete_group, get_graph_statistics, export_subgraph, clear_cache, optimize_storage, and vacuum_database. Each tool should have a clear, single purpose.
Document output schemas for all tools. Include representative JSON examples showing which fields are always present, which are optional, and what data types they contain. Ensure IDs returned (e.g., node_uuid, episode_id) can be passed to downstream tools.
For add_memory, explicitly state: 'This operation modifies the knowledge graph and is not reversible. The episode will be persisted immediately.' Clarify whether repeated calls with the same UUID are idempotent or generate duplicates.
For delete_* operations in manage_graph (now separate tools), add: 'This operation is irreversible. Consider calling export_subgraph first to backup affected data.' Implement a dry_run parameter or require a confirmation step before actual deletion.
Document conditional parameter relationships in search_memory and analyze_patterns. E.g., 'When operation=batch, provide queries array (not query string). When operation=episodes, provide group_id (not group_ids array).'
Add recovery guidance to all tool descriptions: 'If search fails, try a broader query.' 'If a node is not found, call search_memory to discover available nodes.' 'If analysis times out, reduce max_results or time_range_days.'
Implement pagination for search_memory: add support for page/offset and return total_count or next_cursor so agents can fetch large result sets incrementally.
Spec posture evidence
Inferred effective spec: <=2025-11-25.
Relies on Logging (deprecated) - log to stderr or use OpenTelemetry
search_memory and analyze_patterns use operation enums, but descriptions do not document which parameters are required/valid for each operation type. For example, batch operation requires 'queries' array instead of 'query', but this conditional relationship is not documented.
No error handling guidance in any tool description. LLMs cannot recover from failures (e.g., if a node_uuid doesn't exist, what does delete_node return? Is it retryable?). No recovery guide pattern implemented.
manage_graph delete operations marked DESTRUCTIVE but lack permission gates or confirmation steps. No audit trail mechanism documented to prevent accidental data loss via agent mistakes.
search_memory accepts optional 'max_results' (default 10) but does not document pagination support or next_cursor mechanism. Large result sets could exceed context limits, violating paginated-result pattern.
mcp_kg-mcp-server_search_memory
Add permission gates to delete operations: verify the calling user/agent has admin or write:graph scope before executing deletion. Log all destructive operations with timestamps and user IDs for audit trails.
For analyze_patterns, clarify cluster output: 'Returns a list of clusters, each with member nodes and a cluster ID. Use cluster ID in subsequent searches to refine analysis.'
Add error classification to all tools: distinguish retryable errors (network timeout, rate limit) from user-fixable errors (invalid query, node not found) from fatal errors (database corruption). Return actionable error messages like 'Node not found. Available nodes: [node1, node2]. Try searching with search_memory.'
For verbosity enum (summary, compact, full), clarify in descriptions: 'summary = minimal output (name/ID only), compact = essential info (default), full = all relationships and metadata. Use summary for batch operations to save tokens; use full for detailed exploration.'
Consider idempotency: if add_memory with the same UUID overwrites the previous episode, document this clearly. If it generates an error, provide a tool to update_memory separately.