Skip to content

fix: inconsistent error handling across tools + LOC off-by-one #8

@bntvllnt

Description

@bntvllnt

Summary

Two minor consistency issues found during systematic tool testing.

1. Inconsistent error handling for missing entities

Tool Missing input Response
file_context Nonexistent file {"error": "File not found..."}
symbol_context Nonexistent symbol {"error": "Symbol not found..."}
impact_analysis Nonexistent symbol {"levels": [], "totalAffected": 0}

impact_analysis returns empty results instead of an error for unknown symbols. Should match symbol_context behavior and return a clear error.

2. LOC off-by-one

file_context reports mcp/index.ts as 817 LOC. Actual line count is 816.

Likely a fencepost error in the LOC counter (counting from 0 vs 1, or including/excluding the final newline).

Fix

  1. Add symbol existence check at the start of impact_analysis — return error if symbol not in graph
  2. Audit LOC counting logic for off-by-one

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions